Part Number Hot Search : 
SMC210A F116F SPX3431M 30105 2SC4795 670ST 16080 2074734
Product Description
Full Text Search
 

To Download TMP92CM22FG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 TOSHIBA Original CMOS 32-Bit Microcontroller
TLCS-900/H1 Series
TMP92CM22FG
Semiconductor Company
Preface
Thank you very much for making use of Toshiba microcomputer LSIs. Before use this LSI, refer the section, "Points of Note and Restrictions".
TMP92CM22
CMOS 32-Bit Microcontrollers
TMP92CM22FG 1. Outline and Device Characteristics
TMP92CM22 is high-speed advanced 32-bit microcontroller developed for controlling equipment, which processes mass data. TMP92CM22FG is a microcontroller, which has a high-performance CPU (900/H1 CPU) and various built-in I/Os. TMP92CM22F is housed in a 100-pin flat package. Device characteristics are as follows: (1) CPU: 32-bit CPU (900/H1 CPU) * * * * Compatible with TLCS-900, 900/L, 900/L1, 900/H, and 900/H2's instruction code 16 Mbytes of linear address space General-purpose register and register banks Micro DMA: 8 channels (250 ns/4 bytes at fSYS = 20 MHz, best case)
(2) Minimum instruction execution time: 50 ns (at fSYS = 20 MHz) (3) Internal memory * * Internal RAM: 32 Kbytes (32-bit 1-clock access, programmable) Internal ROM: None
070208EBP
RESTRICTIONS ON PRODUCT USE
* The information contained herein is subject to change without notice. 021023_D
* TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property. In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the "Handling Guide for Semiconductor Devices," or "TOSHIBA Semiconductor Reliability Handbook" etc. 021023_A * The TOSHIBA products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These TOSHIBA products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury ("Unintended Usage"). Unintended Usage include atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc. Unintended Usage of TOSHIBA products listed in this document shall be made at the customer's own risk. 021023_B * The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations. 060106_Q * The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patents or other rights of TOSHIBA or the third parties. 021023_C * The products described in this document are subject to foreign exchange and foreign trade control laws. 060925_E * For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3 of the chapter entitled Quality and Reliability Assurance/Handling Precautions. 030619_S
92CM22-1
2007-02-16
TMP92CM22
(4) External memory expansion * * * * Expandable up to 16 Mbytes (Shared program/data area) Can simultaneously support 8-/16-bit width external data bus Dynamic data bus sizing Separate bus system Chip select output: 4 channels
(5) Memory controller (6) 8-bit timers: 4 channels (7) 16-bit timers: 2 channels (8) General-purpose serial interface: 2 channels * * * * UART/synchronous mode IrDA I2C bus mode Clock synchronous mode
(9) Serial bus interface: 1 channel
(10) 10-bit AD converter: 8 channels (11) Watchdog timer (12) Interrupts: 41 interrupts * * * 9 CPU interrupts: Software interrupt instruction and illegal instruction 25 internal interrupts: Seven selectable priority levels 7 external interrupts: Seven selectable priority levels (INT0 to INT5 and NMI ) (INT0 to INT3 selectable edge or level interrupt)
RD
(13) Input/output ports: 50 pins (exclude Data bus 8-bit, Address bus 24-bit and (14) Standby function * * * * * Three HALT modes: IDLE2 (Programmable), IDLE1, STOP PLL: fc = fOSCH x 4 (fc = 40 MHz at fOSCH = 10 MHz) Clock gear function: Select a high-frequency clock fc to fc/16 DVCC = 3.0 V to 3.6 V (fc max = 40 MHz) 100-pin QFP: P-LQFP100-1414-0.50F (15) Dual-clock controller
pin)
(16) Operating voltage (17) Package
92CM22-2
2007-02-16
TMP92CM22
PG0 to PG7 (AN0 to AN7) PG3 ( ADTRG ) AVCC AVSS VREFH VREFL PF0 (TXD0) PF1 (RXD0) PF2 (SCLK0/ CTS0 ) PF3 (TXD1) PF4 (RXD1) PF5 (SCLK1/ CTS1 ) PF6 to PF7 P90 (SCK) P91 (SO/SDA) P92 (SI/SCL) 10-bit 8-ch AD converter XWA XBC Serial I/O SIO0 XDE XHL XIX Serial I/O SIO1 XIY XIZ Port F Serial bus I/F SBI0 XSP 32 bits SR PC F 900/H1 CPU PLL W B D H IX IY IZ SP Data bus Port 1 Port 4 Port 5 PC0 (TA0IN) PC1 (TA1OUT/INT1) 8-bit timer (Timer A0) 8-bit timer (Timer A1) 8-bit timer (Timer A2) PC5 (TA3OUT/INT2) 8-bit timer (Timer A3) 32-Kbyte RAM PC6 (TB00UT0/INT3) PD0 (TB1IN0/INT4) PD1 (TB1IN1/INT5) PD2 (TB1OUT0) PD3 (TB1OUT1) 16-bit timer (Timer B1) Port A 16-bit timer (Timer B0) Watchdog timer Port 6 A C E L Mode controller Interrupt controller H-OSC Clock gear
DVCC [3] DVSS [4]
X1 X2
RESET
AM0 AM1
NMI
PC3(INT0) D0 to D7 P10 to P17 (D8 to D15) P40 to P47 (A0 to A7) P50 to P57 (A8 to A15) P60 to P67 (A16 to A23) P70 ( RD ) P71 ( WRLL ) P72 ( WRLU ) P73 P74 (CLKOUT) P75 (R/ W ) P76 ( WAIT ) P80 ( CS0 )
Port 7
Port 8
P81 ( CS1 ) P82 ( CS2 ) P83 ( CS3 ) PA0 to PA2 PA7
Figure 1.1 TMP92CM22 Block Diagram
92CM22-3
2007-02-16
TMP92CM22
2.
Pin Assignment and Functions
The assignment of input/output pins for the TMP92CM22FG, their names and functions are as follows.
2.1
Pin Assignment
Figure 2.1.1 shows the pin assignment of the TMP92CM22FG.
PD1/TB1IN1/INT5
PD0/TB1IN0/INT4
PD3/TB1OUT1
PD2/TB1OUT0
P91/SO/SDA
P92/SI/SCL
P74/CLKOUT
P72/WRLU
P75/R/W
P71/WRLL
P76/WAIT
P90/SCK
100
95
90
85
80
P67/A23
P83/CS3
P82/CS2
P81/CS1
P80/CS0
PA2
PA1
PA0
P70/RD
DVSS4
AVCC
AVSS
P73
VREFL VREFH PG0/AN0 PG1/AN1 PG2/AN2 PG3/AN3/ ADTRG PG4/AN4 PG5/AN5 PG6/AN6 PG7/AN7 PA7 PC0/TA0IN PC1/TA1OUT/INT1 PC5/TA3OUT/INT2 PC6/TB0OUT0/INT3 PF0/TXD0 PF1/RXD0 PF2/SCLK0/ CTS0 PF3/TXD1 PF4/RXD1 PF5/SCLK1/ CTS1 PF6 PF7
NMI
1
75
P66/A22 P65/A21 P64/A20 DVCC3
5 70
P63/A19 P62/A18 P61/A17 P60/A16 P57/A15
10
TMP92CM22 QFP100 Top view
P56/A14 65 P55/A13 P54/A12 P53/A11 P52/A10 P51/A9 60 P50/A8 P47/A7 P46/A6 P45/A5
15
20 55
P44/A4 P43/A3 P42/A2 P41/A1 P40/A0
DVCC1
25 30 35 40 45 50
DVSS3
P10/D8
P11/D9
RESET
D0
D1
D2
D3
D4
D5
D6
AM1
AM0
D7
X1
X2
P12/D10
P13/D11
P14/D12
P15/D13
P16/D14
Figure 2.1.1 Pin Assignment Diagram (100-Pin QFP)
PC3/INT0
P17/D15
DVSS2
DVCC2
DVSS1
92CM22-4
2007-02-16
TMP92CM22
2.2
Pin Names and Functions
The following tables show the names and functions of the input/output pins. Table 2.2.1 Pin Names and Functions (1/2)
Pin Names
D0 to D7 P10 to P17
Number of Pins
8 8
I/O
I/O I/O I/O Data (Lower): Data bus D0 to D7.
Functions
Port 1: I/O port that allows I/O to be selected at the bit level. (when used to the external 8-bit bus.) Data: Data bus D8 to D15. Port 4: I/O port. Address: Address bus A0 to A7. Port 5: I/O port. Address: Address bus A8 to A15. Port 6: I/O port. Address: Address bus A16 to A23. Port 70: Output port. Read: Strobe signal for reading external memory. Port 71: Output port. Write: Strobe signal for writing data to pins D0 to D7. Port 72: Output port. Write: Strobe signal for writing data to pins D8 to D15. Port 73: Output port. Port 74: Output port. Clock: Output system clock. Port 75: Output port. Read/write: This port is 1 when read and dummy cycle. This port is 0 when write cycle. Port 76: I/O port. Wait: Pin used to request bus wait to CPU. Port 80: Output port. Chip select 0: Outputs 0 when address is within specified address area. Port 81: Output port. Chip select 1: Outputs 0 when address is within specified address area. Port 82: Output port. Chip select 2: Outputs 0 when address is within specified address area. Port 83: Output port. Chip select 3: Outputs 0 when address is within specified address area. Port 90: I/O port. Serial bus interface clock I/O data at SIO mode. Port 91: I/O port. Serial bus interface send data at SIO mode. Serial bus interface send/receive data at I C mode. (Open-drain output mode by programmable.) Port 92: I/O port. Serial bus interface receive data at SIO mode. Serial bus interface clock I/O data at I C mode. (Open-drain output mode by programmable.)
2 2
D8 to D15 P40 to P47 A0 to A7 P50 to P57 A8 to A15 P60 to P67 A16 to A23 P70
RD
8 8 8 1 1 1 1 1 1 1 1 1 1 1 1
I/O Output I/O Output I/O Output Output Output Output Output Output Output Output Output Output Output Output I/O Input Output Output Output Output Output Output Output Output I/O I/O I/O Output I/O I/O
P71
WRLL
P72
WRLU
P73 P74 CLKOUT P75 R/ W P76
WAIT
P80
CS0
P81
CS1
P82
CS2
P83
CS3
P90 SCK P91 SO SDA P92 SI SCL PA0 to PA2, PA7
1
1
Input I/O
4
Input
Port A0 to A2, A7: Input port (with pull-up resistor).
92CM22-5
2007-02-16
TMP92CM22
Table 2.2.2 Pin Names and Functions (2/2)
Pin Names
PC0 TA0IN PC1 INT1 TA1OUT PC3 INT0 PC5 INT2 TA3OUT PC6 INT3 TB0OUT0 PD0 INT4 TB1IN0 PD1 INT5 TB1IN1 PD2 TB1OUT0 PD3 TB1OUT1 PF0 TXD0 PF1 RXD0 PF2 SCLK0
CTS0
Number of Pins
1
I/O
I/O Input I/O Input Output I/O Input I/O Input Output I/O Port C0: I/O port. Timer input: 8-bit timer A0 input. Port C1: I/O port.
Functions
1
Interrupt request pin 1: Interrupt request pin with programmable level/rising edge/falling edge. Timer output: 8-bit timer A0 or timer A1 output. Port C3: I/O port. Interrupt request pin 0: Interrupt request pin with programmable level/rising edge/falling edge. Port C5: I/O port. Interrupt request pin 2: Interrupt request pin with programmable level/rising edge/falling edge. Timer output: 8-bit timer A2 or timer A3 output. Port C6: I/O port. Interrupt request pin 3: Interrupt request pin with programmable level/rising edge/falling edge. Timer output: 16-bit timer B0 output. Port D0: I/O port. Interrupt request pin 4: Interrupt request pin with programmable rising edge/falling edge. Timer input: 16-bit timer B1 input 0. Port D1: I/O port. Interrupt request pin 5: Interrupt request pin with programmable rising edge/falling edge. Timer input: 16-bit timer B1 input 1. Port D2: I/O port. Timer output: 16-bit timer B1 output 0. Port D3: I/O port. Timer output: 16-bit timer B1 output 1. Port F0: I/O port. Serial send data 0: (Open-drain output mode by programmable.) Port F1: I/O port. Serial receive data 0. Port F2: I/O port. Serial 0 clock I/O. Serial data send enable 0 (Clear to send). Port F3: I/O port. Serial send data 1: (Open-drain output mode by programmable.) Port F4: I/O port. Serial receive data 1. Port F5: I/O port. Serial 1 clock I/O. Serial data send enable 1 (Clear to send). Port F6 to F7: I/O port. Port G0 to G7: Input port. Analog input 0 to 7: Pin used to input to AD converter. AD trigger: Pin used to request AD converter start (Share with PG3). Non-Maskable interrupt request pin. Operation mode: Fixed to AM1 = "0", AM0 = "1": External 16-bit bus start, 8-/16-bit dynamic sizing. Fixed to AM1 = "1", AM0 = "0": External 8-bit bus start, 8-/16-bit dynamic sizing. High-frequency oscillator connection pin. Reset: Initialize TMP92CM22 (Schmitt input, with pull-up resistor). Pin for reference voltage input to AD converter (H). Pin for reference voltage input to AD converter (L). Power supply pin for AD converter. GND pin for AD converter (0 V). Power supply pins (All Vcc pins should be connected with the power supply pin).
1
1
1
Input Output I/O
1
Input Input I/O
1
Input Input I/O Output I/O Output I/O Output I/O Input I/O I/O Input I/O Output I/O Input I/O I/O Input I/O Input Input Input Input Input I/O Input Input Input
1 1 1 1
1
PF3 TXD1 PF4 RXD1 PF5 SCLK1
CTS1
1 1
1 2 8 1 2 2 1 1 1 1 1 3 4
PF6 to PF7 PG0 to PG7 AN0 to AN7
ADTRG NMI
AM0, AM1 X1/X2
RESET
VREFH VREFL AVCC AVSS DVCC DVSS
-
GND pins (0 V) (All DVSS pins should be connected with GND (0 V)).
92CM22-6
2007-02-16
TMP92CM22
3.
Operation
This section describes the basic components, functions and operation of the TMP92CM22.
3.1
CPU
The TMP92CM22 incorporates a high-performance 32-bit CPU (The TLCS-900/H1 CPU). For a description of this CPU's operation, please refer to the section of this data book which describes the TLCS-900/H1 CPU. The following sub-sections describe functions peculiar to the CPU used in the TMP92CM22; these functions are not covered in the section devoted to the TLCS-900/H1 CPU.
3.1.1
Outline
"TLCS-900/H1 CPU" is high-speed and high-performance CPU based on "TLCS-900/L1 CPU". "TLCS-900/H1 CPU" has expanded 32-bit internal and external data bus to process instructions more quickly. Outline of "TLCS-900/H1" CPU are as follows: Table 3.1.1 Outline of CPU
Width of CPU address bus Width of CPU data bus Internal operating frequency Minimum bus cycle Function of data bus sizing Internal RAM Internal I/O External device Minimum instruction execution cycle Conditional jump Instruction queue buffer Instruction set
24 bits 32 bits 20 MHz 1-clock access (50 ns at 20 MHz) 8 bits 32 bits 1-clock access 8-/16-bit 8-/16-bit 8 bits 2-clock access (can insert some waits) 1 clock (50 ns at 20 MHz) 2 clocks (100 ns at 20 MHz) 12 bytes Compatible with TLCS-900, 900/L, 900/H, 900/L1, and 900/H2 instruction codes (However, NORMAL, MAX, MIN, and LDX instructions is deleted) Only maximum mode 8 channels 2-clock access 5-to 6-clock access 900/H1 I/O 900/H1 I/O
CPU mode Micro DMA
92CM22-7
2007-02-16
TMP92CM22 3.1.2 Reset Operation
When resetting the TMP92CM22 microcontroller, ensure that the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. Then hold the RESET input to low for at least 20 system clocks (16 s at fc = 40 MHz). When the reset has been accepted, the CPU performs the following: * Sets the program counter (PC) as follows in accordance with the reset vector stored at address FFFF00H to FFFF02H: PC<7:0> Data in location FFFF00H PC<15:8> Data in location FFFF01H PC<23:16> Data in location FFFF02H * * * Sets the stack pointer (XSP) to 00000000H. Sets bits of the status register (SR) to 111 (Thereby setting the interrupt level mask register to level 7). Clears bits of the status register to 00 (Thereby selecting register bank 0).
When the reset is released, the CPU starts executing instructions according to the program counter settings. CPU internal registers not mentioned above do not change when the reset is released. When the reset is accepted, the CPU sets internal I/O, ports and other pins as follows. * * Initializes the internal I/O registers as "Table of Special Function Registers (SFRs)" in Section 5. Sets the input or output port to general-purpose input port.
Internal reset is released as soon as external reset is released and RESET input pin is set to "H". The operation of memory controller cannot be insured until power supply becomes stable after power-on reset. The external RAM data provided before turning on the TMP92CM22 may be spoiled because the control signals are unstable until power supply becomes stable after power on reset.
Figure 3.1.1 shows the timing of a reset for the TMP92CM22.
92CM22-8
2007-02-16
TMP92CM22
VCC 3.3 V
RESET
Oscillator operation time + 20 system clocks
0 [s] (Min)
Figure 3.1.1 Reset Timing Example
3.1.3
Outline of Operation Mode
Set AM1 and AM0 pins to "10" to use 8-bit external bus, or set it to "01" to use 16-bit external bus. Table 3.1.2 Operation Mode Setup Table Operation
16-bit external bus start 8-/16-bit dynamic bus sizing 8-bit external bus start 8-/16-bit dynamic bus sizing
Mode Setting Input Pin RESET AM1
0 1
AM0
1 0
92CM22-9
2007-02-16
TMP92CM22
3.2
Memory Map
Figure 3.2.1 shows memory map of TMP92CM22.
000000H Internal I/O (8 Kbytes) 000100H 001FE0H 002000H Internal RAM (32 Kbytes) Direct area(n)
64-Kbyte area (nn)
00A000H
010000H
External memory
F00000H
F10000H
Provisinal emulator control area (64 Kbytes)
External memory 16-Mbyte area (R) ( - R) (R + ) (R + R8/16) (R + d8/16) (nnn) FFFF00H Vector table (256 bytes) FFFFFFH ( = Internal area)
Figure 3.2.1 Memory Map
Note 1: When use emulator, optional 64 Kbytes of 16-Mbyte area are used to control emulator. Therefore, don't use this area. Note 2: Don't use the last 16-byte area (FFFFF0H to FFFFFFH). This area is reserved. Note 3: On emulator WRLL signal, WRLU signal and emulator control area is accessed. Be careful to use extend memory.
RD
signal are asserted, when provisional
92CM22-10
2007-02-16
TMP92CM22
3.3
Clock Function and Standby Function
TMP92CM22 contains (1) Clock gear, (2) Standby controller and (3) Noise-reducing circuit. It is used for low-power, low-noise systems. This chapter is organized as follows: 3.3.1 Block Diagram of System Clock 3.3.2 SFRs 3.3.3 System Clock Controller 3.3.4 Clock Doubler (PLL) 3.3.5 Noise Reduction Circuits 3.3.6 Standby Controller
92CM22-11
2007-02-16
TMP92CM22
The clock operating modes are as follows: (a) Single clock mode (X1 and X2 pins only), (b) Dual clock mode (X1, X2 pins and PLL). Figure 3.3.1 shows a transition figure.
Reset (fOSCH/32) Release reset IDLE2 mode (I/O operation) IDLE1 mode (Operate only oscillator) Instruction Interrupt Instruction Interrupt (a) NORMAL mode (fOSCH/gear value/2) Instruction Interrupt STOP mode (Stop all circuit )
Single clock mode transition figure Reset (fOSCH/32)
IDLE2 mode (I/O operation) IDLE1 mode (Operate only oscillator) IDLE2 mode (I/O operation) IDLE1 mode (Operate oscillator and PLL )
Instruction Interrupt Instruction Interrupt
Release reset NORMAL mode (fOSCH/gear value/2) Instruction Interrupt STOP mode (Stop all circuit )
Instruction Instruction Interrupt Instruction Interrupt NORMAL mode (4 x fOSCH/gear value/2) (Using PLL) (b) Dual clock mode transition figure
Figure 3.3.1 System Clock Block Diagram
The clock frequency input from the X1 and X2 pins is called fOSCH and the clock frequency selected by SYSCR1 is called the clock fFPH. The system clock fSYS is defined as the divided 2 clocks of fFPH, and one cycle of fSYS is defined to as one state.
92CM22-12
2007-02-16
TMP92CM22 3.3.1 Block Diagram of System Clock
SYSCR2 PLLCR Warm-up timer (for high-frequency oscillator)/lockup (for PLL) timer T T0 fFPH fPLL = fOSCH x 4 fc fc/2 PLLCR PLL (Clock doubler) X1 X2 Highfrequency oscillator fOSCH fc/4 fc/8 fc/16 /2 /4 /8 /16 Clock gear PLLCR /2 /2 SYSCR1 fSYS fiO /4 /8
fSYS fiO T0
TMRA0 to TMRA3 and TMRB0 to TMRB1 Prescaler
CPU RAM Interrupt controller
SIO0 and SIO1 Prescaler ADC I/O port SBI T Prescaler WDT
Figure 3.3.2 Block Diagram of Dual Clock and System Clock
92CM22-13
2007-02-16
TMP92CM22 3.3.2 SFRs
7
SYSCR0 (10E0H) Bit symbol Read/Write After reset Function SYSCR1 (10E1H) Bit symbol Read/Write After reset Function - R/W 1 Always write "1".
6
5
4
3
2
- R/W 0 Always write "0".
1
0
- 0 Always write "0".
GEAR2 R/W 1
GEAR1 0
GEAR0 0
Select gear value of highfrequency oscillator 000: High-frequency oscillator 001: High-frequency oscillator/2 010: High-frequency oscillator/4 011: High-frequency oscillator/8 100: High-frequency oscillator/16 101: 110: 111: Reserved SELDRV 0 Select using mode 0: STOP 1: IDLE1 DRVE 0 1: Pin state control in STOP/ IDLE1 mode
SYSCR2 (10E2H)
Bit symbol Read/Write After reset Function
- R/W 0 Always write "0".
WUPTM1 1
WUPTM0 0
HALTM1 1 00: Reserved
HALTM0 1
R/W Select WUP time for oscillator 00: Reserved 01: 2 /Input frequency 10: 2 /Input frequency 11: 2 /Input frequency
16 14 8
Select HALT mode 01: STOP mode 10: IDLE1 mode 11: IDLE2 mode
Note:
The unassigned register, SYSCR0, SYSCR0, SYSCR1, and SYSCR2 are RD as undefined value.
Figure 3.3.3 SFR for System Clock
92CM22-14
2007-02-16
TMP92CM22
7
PLLCR (10E8H) Bit symbol Read/Write After reset Function 0 0: PLL stop 1: PLL run PLLON R/W
6
FCSEL 0
0: fc = OSCH 1: fc = PLL (x 4)
5
LWUPFG R 0 PLL warm-up flag 0: Don't end up or stop 1: End up
4
3
2
1
0
Note:
Logic of PLLCR is different DFM of 900/L1.
Figure 3.3.4 SFR for PLL
7
EMCCR0 (10E3H) Bit symbol Read/Write After reset Function PROTECT R 0 Protect 0: OFF 1: ON EMCCR1 (10E4H) Bit symbol Read/Write After reset Function EMCCR2 (10E5H) Bit symbol Read/Write After reset Function
6
5
4
3
2
EXTIN 0
1
DRVOSCH R/W 1
0
-
1
1: fc fc oscillator Always external driver ability write "1". clock
1: Normal 0: Weak
Switching the protect ON/OFF by write to following 1st-KEY, 2nd-KEY 1st-KEY: EMCCR1 = 5AH, EMCCR2 = A5H in succession write 2nd-KEY: EMCCR1 = A5H, EMCCR2 = 5AH in succession write
Note: In case restarting the oscillator in the stop oscillation state (e.g. Restart the oscillator in STOP mode), set EMCCR0, = "1".
Figure 3.3.5 SFR for Noise
92CM22-15
2007-02-16
TMP92CM22 3.3.3 System Clock Controller
The system clock controller generates the system clock signal (fSYS) for the CPU core and internal I/O. It is used as input that fc outputted from high-frequency oscillation circuit and PLL (Clock doubler) SYSCR1, SYSCR1 sets the high-frequency clock gear to either 1, 2, 4, 8, or 16 (fc, fc/2, fc/4, fc/8, or fc/16). These functions can reduce the power consumption of the equipment in which the device is installed. Single clock mode is set by resetting, initialized to = "100". This setting will cause the system clock (fSYS) to be set to fc/32 (fc/16x1/2). For example, fSYS is set to 1.25 MHz when the 40MHz oscillator is connected to the X1 and X2 pins. (1) Clock gear controller fFPH is set according to the contents of the clock gear select register SYSCR1 to either fc, fc/2, fc/4, fc/8, or fc/16. Using the clock gear to select a lower value of fFPH reduces power consumption.
Example: Changing to a high-frequency gear SYSCR1 X: Don't care EQU LD 10E1H (SYSCR1), XXXX0100B ; Changes system clock fSYS to fc/32.
(High-speed clock gear changing) To change the clock gear, write the register value to the SYSCR1 register. It is necessary the warm-up time until changing after writing the register value. There is the possibility that the instruction next to the clock gear changing instruction is executed by the clock gear before changing. To execute the instruction next to the clock gear switching instruction by the clock gear after changing, input the dummy instruction as follows (Instruction to execute the write cycle).
Example: SYSCR1 EQU LD LD 10E1H (SYSCR1), XXXX0001B (DUMMY), 00H Instruction to be executed after clock gear has changed. ; ; Changes fSYS to fc/4. Dummy instruction.
92CM22-16
2007-02-16
TMP92CM22 3.3.4 Clock Doubler (PLL)
PLL outputs the fPLL clock signal, which is four times as fast as fOSCH. A reset initializes PLL to stop status, setting to PLLCR register is needed before use. Like an oscillator, this circuit requires time to stabilize. This is called the lockup time. Note 1: Input frequency limitation for PLL The limitation of input frequency (High-frequency oscillation) for PLL is the following. fOSCH = 4 to 10 MHz (Vcc = 3.0 V to 3.6 V) Note 2: PLLCR The logic of PLLCR is different from 900/L1's DFM. Be careful to judge an end of lockup time. The following is a setting example for PLL starting and PLL stopping.
Example 1: PLL starting PLLCR EQU LD LUP: BIT JR LD X: Don't care 10E8H (PLLCR), 10XXXXXXXB 5, (PLLCR) Z, LUP (PLLCR), 11XXXXXXB ; ; ; ; Enables PLL operation and starts lockup. Detects end of lockup. Changes fc from 10 MHz to 40 MHz.
PLL output: fPLL Lockup timer System clock fSYS Starts PLL operation and starts lockup. Changes from 10 MHz to 40 MHz. Ends of lockup Count-up by fOSCH During lockup After lockup
92CM22-17
2007-02-16
TMP92CM22
Example 2: PLL stopping PLLCR EQU LD LD X: Don't care PLL output: fPLL System clock fSYS Changes from 40 MHz to 10 MHz. Stops PLL operation. 10E8H (PLLCR), 10XXXXXXB (PLLCR), 00XXXXXXB ; ; Changes fc from 40 MHz to10 MHz. Stop PLL.
Limitation point on the use of PLL 1. When PLL is started, don't set fc from fOSCH to fPLL at same time. Don't setting: LD LD (PLLCR), 00H (PLLCR), C0H
2. When PLL is started, don't set fc from fOSCH to fPLL at same time. Don't setting: LD LD (PLLCR), C0H (PLLCR), 00H
92CM22-18
2007-02-16
TMP92CM22 3.3.5 Noise Reduction Circuits
Noise reduction circuits are built in for reduction EMI (Unnecessary radius noise) and reinforcement EMS (Measure of endure noise), allowing implementation of the following features. (1) Reduced drivability for high-frequency oscillator (2) Single drive for high-frequency oscillator (3) SFR protection of register contents These functions need setting by EMCCR0 to EMCCR2. (1) Reduced drivability for high-frequency oscillator (Purpose) Reduces noise and power for oscillator when connect oscillator to outside. (Block diagram)
fOSCH C1 Oscillator EMCCR0 C2 X2 pin X1 pin Oscillation enable ( STOP + EMCCR0 < EXTIN > )
(Setting method) The drivability of the oscillator is reduced by writing "0" to EMCCR0 register. By reset, is initialized to "1" and the oscillator starts oscillation by normal drivability when the power supply is on.
Note:
When use drivability reduction function of oscillator, please use in case of fOSCH = 4 MHz to 10 MHz condition.
92CM22-19
2007-02-16
TMP92CM22
(2) Single drive for high-frequency oscillator (Purpose) Not need twin-drive and protect mistake operation by inputted noise to X2 pin when the external oscillator is used. (Block diagram)
fOSCH X1 pin Oscillation enable ( STOP + EMCCR0 < EXTIN > ) EMCCR0
X2 pin
(Setting method) The oscillator is disabled and starts operation as buffer by writing "1" to EMCCR0 register. X2 pin is always outputted "1". By reset, is initialized to "0".
92CM22-20
2007-02-16
TMP92CM22
(3) Runaway provision with SFR protection register (Purpose) Provision in runaway of program by noise mixing. Write operation to specified SFR is prohibited so that provision program in runaway prevents that is in the state which is fetch impossibility by stopping of clock, memory control register (Memory controller) is changed. And error handling in runaway becomes easy by INTP0 interruption. Specified SFR list 1. Memory controller B0CSL/H, B1CSL/H, B2CSL/H, B3CSL/H, BEXCSL/H, MSAR0, MSAR1, MSAR2, MSAR3, MAMR0, MAMR1, MAMR2, MAMR3, and PMEMCR 2. Clock gear (EMCCR1, EMCCR2 write enable) SYSCR0, SYSCR1, SYSCR2, and EMCCR0 (Operation explanation) Execute and release of protection (write operation to specified SFR) becomes possible by setting up a double key to EMCCR1 and EMCCR2 registers.
(Double key) 1st-KEY: Succession writes in 5AH at EMCCR1 and A5H at EMCCR2. 2nd-KEY: Succession writes in A5H at EMCCR1 and 5AH at EMCCR2.
A state of protection can be confirmed by reading EMCCR0. By reset, protection becomes OFF. And INTP0 interruption occurs when write operation to specified SFR was executed with protection on state.
92CM22-21
2007-02-16
TMP92CM22 3.3.6 Standby Controller
(1) HALT modes When the HALT instruction is executed, the operating mode switches to IDLE2, IDLE1, or STOP mode, depending on the contents of the SYSCR2 register. The subsequent actions performed in each mode are as follows: a. IDLE2: Only the CPU halts. The internal I/O is available to select operation during IDLE2 mode by setting the following register. Table 3.3.1 shows the registers of setting operation during IDLE2 mode.
Table 3.3.1 SFR Seting Operation during IDLE2 Mode Internal I/O
TMRA01 TMRA23 TMRB0 TMRB1 SIO0 SIO1 AD converter WDT SBI
SFR
TA01RUN TA23RUN TB0RUN TB1RUN SC0MOD1 SC1MOD1 ADMOD1 WDMOD SBI0BR0
b. c.
IDLE1: Only internal oscillator operates. STOP: All internal circuit stop. The operation of each of the different HALT modes is described in Table 3.3.2. Table 3.3.2 Each Block Operation in HALT Mode
HALT Mode SYSCR2
CPU Operation block I/O port TMRA, TMRB SIO, *SBI AD converter WDT
IDLE2 11
Stop Keep the state when the HALT instruction is executed. * Selection enable operation block to programmable
IDLE1 10
STOP 01
Refer Table 3.3.5, Table 3.3.6
Stop
*: Except clocked-synchronous 8-bit SIO mode for SBI.
92CM22-22
2007-02-16
TMP92CM22
(2) How to release the HALT mode These halt states can be released by resetting or requesting an interrupt. The halt release sources are determined by the combination between the states of interrupt mask register and the HALT modes. The details for release the halt status are shown in Table 3.3.3. * Released by requesting an interrupt The operating released from the HALT mode depends on the interrupt enabled status. When the interrupt request level set before executing the HALT instruction exceeds the value of interrupt mask register, the interrupt due to the source is processed after release the HALT mode, and CPU status executing an instruction that follows the HALT instruction. When the interrupt request level set before executing the HALT instruction is less than the value of the interrupt mask register, release the HALT mode is not executed. (In non-maskable interrupts, interrupt processing is processed after release the HALT mode regardless of the value of the mask register.) However only for INT0 to INT3 interrupts, even if the interrupt request level set before executing the HALT instruction is less than the value of the interrupt mask register, release the HALT mode is executed. In this case, interrupt processing, and CPU starts executing the instruction next to the HALT instruction, but the interrupt request flag is held at "1". * Release by resetting Release all halt status is executed by resetting. When the STOP mode is released by RESET, it is necessary enough resetting time (Refer Table 3.3.4) to set the operation of the oscillator to be stable. When release the HALT mode by resetting, the internal RAM data keeps the state before the "HALT" instruction is executed. However the other settings contents are initialized. (Release due to interrupts keeps the state before the "HALT" instruction is executed.)
92CM22-23
2007-02-16
TMP92CM22
Table 3.3.3 Source of Halt State Release and Halt Release Operation Status of Received Interrupt HALT Mode
NMI Source of HALT state release INTWDT INT0 to 3 (Note1) Interrupt INT4 to 5 INTTA0 to 3, INTTB00, 01, 10, 11, O0, O1 INTRX0 to 1, TX0 to 1 INTAD INTSBE0 Reset
Interrupt Enable
(Interrupt level) (Interrupt mask)
Programmable IDLE2
Interrupt Disable
(Interrupt level) < (Interrupt mask)
Programmable IDLE2
IDLE1
x x x x x x x
STOP
x *1 x x x x x x
IDLE1
- -
STOP
- -

- -
x x x x x x
x x x x x x
*1
x x x x x x
Initialize LSI
:
After release the HALT mode, CPU starts interrupt processing. After release the HALT mode, CPU resumes executing starting from instruction following the HALT instruction. (Interrupt don't process.) It can not be used to release the HALT mode. The priority level (Interrupt request level) of non-maskable interrupts is fixed to 7, the highest priority level. There is not this combination type. Release the HALT mode is executed after passing the warm-up time.
:
x: -: *1:
Note 1: When the HALT mode is released by INT0 to INT3 interrupts of the level mode in the interrupt enabled status, hold this level until starting interrupt processing. Changing level before holding level, interrupt processing is correctly started. Note 2: When use external interrupt INT4 to INT5 are used during IDLE2 mode, set 16-bit timer RUN register TB1RUN to "1". (Example release HALT mode) An INT0 interrupt release the halt state when the device is in IDLE1 mode.
Address 8203H 8206H 8209H 820BH 820EH INT0 LD LD EI LD HALT (IIMC), 00H (INTE0AD), 06H 5 (SYSCR2), 28H ; ; ; ; ; Selects INT0 interrupt rising edge. Sets INT0 interrupt level to 6. Sets CPU interrupt level to 5. Sets HALT mode to IDLE1 mode. Halts CPU. INT0 interrupt routine RETI 820FH LD XX, XX
92CM22-24
2007-02-16
TMP92CM22
(3) Operation a. IDLE2 mode In IDLE2 mode only specific internal I/O operations, as designated by the IDLE2 setting register, can take place. Instruction execution by the CPU stops. Figure 3.3.6 illustrates an example of the timing for clearance of the IDLE2 mode halt state by an interrupt.
X1 A0 to A23 D0 to D15
RD WR
Data Data
Interrupt of releasing halt IDLE2 mode
Figure 3.3.6 Timing Chart for IDLE2 Mode Halt State Released by Interrupt b. IDLE1 mode In IDLE1 mode, only the internal oscillator operates. The system clock stops. And, pin state in IDLE1 mode depend on setting SYSCR2 register. Table 3.3.5, Table 3.3.6 shows pin state in IDLE1 mode. In the halt state, the interrupt request is sampled asynchronously with the system clock; however, clearance of the halt state (e.g., restart of operation) is synchronous with it. Figure 3.3.7 shows the timing for release of the IDLE1 mode halt state by an interrupt.
X1 A0 to A23 D0 to D15
RD WR
Data Data
Interrupt of releasing halt IDLE1 mode
Figure 3.3.7 Timing Chart for IDLE1 Mode Halt State Released by Interrupt
92CM22-25
2007-02-16
TMP92CM22
c. STOP mode When STOP mode is selected, all internal circuits stop, including the internal oscillator pin status in STOP mode depends on the settings in the SYSCR2 register. Table 3.3.5, Table 3.3.6 shows the state of these pins in STOP mode. After STOP mode has been released system clock output starts when the warm-up time has elapsed, in order to allow oscillation to stabilize. Warm-up time set by SYSCR2 register. See the sample warm-up times in Table 3.3.4. Figure 3.3.8 illustrates the timing for release of the STOP mode halt state by an interrupt.
Warm-up time
X1 A0 to A23 D0 to D15
RD WR
Data Data
Interrupt of releasing halt STOP mode
Figure 3.3.8 Timing Chart for STOP Mode Halt State Released by Interrupt
Table 3.3.4 Sample Warm-up Times after Rrelease of STOP Mode
at fOSCH = 10 MHz
SYSCR2 01 (2 )
25.6 s
8
10 (214)
1.638 ms
11 (216)
6.554 ms
92CM22-26
2007-02-16
TMP92CM22
Table 3.3.5 Input Buffer State Table
Input Buffer State Port Name Input Function Name Input Buffer State During Reset When Used as function Pin ON upon external read
-
Input Buffer State When Used as function Pin OFF When Used as Input Port
-
When Used as Input Port
-
In HALT mode (IDLE1/STOP) Condition A (Note) Condition B (Note) When When When When Used as Used as Used as Used as function Input function Input Pin Port Pin Port
- -
D0-D7 P10-P17 P40-P47 P50-P57 P60-P67 P76 P90 P91 P92 PA0-PA7(*1) PC0 PC1 PC3 PC5 PC6 PD0 PD1 PD2 PD3 PF0 PF1 PF2 PF3 PF4 PF5 PF6 PF7 PG0-2, PG4-7(*2) PG3(*2)
D0-D7 D8-D15
OFF
OFF
- - -
WAIT SCK SDA SI SCL
OFF
-
-
-
OFF OFF ON OFF
OFF
OFF
ON
-
OFF
-
TA0IN INT1 INT0 INT2 INT3 INT4, TB1IN0 INT5, TB1IN1
-
ON OFF ON
- OFF
ON OFF ON
- OFF
ON OFF ON
ON
ON
ON
ON
ON
ON
OFF
OFF
OFF
- - -
RXD0 SCLK0, CTS0
-
-
-
-
ON
-
ON
-
ON OFF
OFF
-
OFF
OFF
-
OFF
-
RXD1 SCLK1, CTS1
ON
ON ON
OFF
OFF
- - -
-
OFF
ADTRG
ON upon port read
-
-
-
-
OFF
NMI
RESET(*1) AM0,1 X1
- - -
ON ON
ON
-
ON
-
ON
-
ON: The buffer is always turned on. A current flows the input buffer if the input pin is not driven. OFF: The buffer is always turned off.
-: No applicable
*1: Port having a pull-up/pull-down resistor. *2: AIN input does not cause a current to flow through the buffer.
Note: Condition A/B are as follows. SYSCR2 register setting 0 0 1 1 0 1 0 1 HALT mode IDLE1 Condition B Condition A Condition B STOP Condition A Condition B
92CM22-27
2007-02-16
TMP92CM22
Table 3.3.6 Output Buffer State Table
Output Buffer State Port Name Output Function Name When the CPU is Operating During Reset When Used as Function Pin ON upon external read When Used as Output Port
-
In HALT mode(IDLE2) When Used as Function Pin OFF When Used as Output Port
-
In HALT mode (IDLE1/STOP) Condition A (Note) When Used as Function Pin When Used as Output Port
-
Condition B (Note) When Used as Function Pin OFF When Used as Output Port
-
D0-D7 P10-P17 P40-P47 P50-P57 P60-P67 P70 P71 P72 P73 P74 P75 P76 P80 P81 P82 P83 P90 P91 P92 PC0 PC1 PC3 PC5 PC6 PD0 PD1 PD2 PD3 PF0 PF1 PF2 PF3 PF4 PF5 PF6 PF7 X2
D0-D7 D8-D15 A0-A7 A8-A15 A16-A23
RD
OFF
ON
OFF ON ON ON ON
WRLL WRLU WRUL WRUU R/W
-
OFF
-
-
-
-
CS0 CS1 CS2 CS3 SCK SO SCL
- -
ON ON ON OFF ON
ON
-
ON
-
ON OFF
-
TA1OUT
-
ON
-
ON
-
OFF
-
ON
-
TA3OUT TB0OUT
- -
ON
-
ON
-
OFF
-
ON
-
TB1OUT0 TB1OUT1 TXD0
-
OFF
ON ON ON
- - - -
OFF
ON
SCLK0 TXD1
-
ON
-
ON
-
OFF
-
ON
-
SCLK1
- - -
ON
- -
ON
-
OFF
- -
ON
-
ON
IDLE1: ON, STOP: High level output
ON: The buffer is always turned on. When the bus is released, however ,output buffers for some pins are turned off. OFF: The buffer is always turned off.
-: No applicable Note: Condition A/B are as follows. SYSCR2 register setting
HALT mode IDLE1 Condition B Condition A Condition B STOP Condition A Condition B
0 0 1 1
0 1 0 1
92CM22-28
2007-02-16
TMP92CM22
3.4
Interrupt
Interrupts of TLCS-900/H1 are controlled by the CPU interrupt mask flip-flop (IFF2:0) and by the built-in interrupt controller. The TMP92CM22 has a total of 41 interrupts divided into the following types: Interrupts generated by CPU: 9 sources (Software interrupts: 8 sources, illegal instruction interrupt: 1 source) External interrupts ( NMI and INT0 to INT5): 7 sources Internal I/O interrupts: 17 sources High-speed DMA interrupts: 8 sources A individual interrupt vector number (Fixed) is assigned to each interrupt. One of six priority level (Variable) can be assigned to each maskable interrupt. The priority level of non-maskable interrupts are fixed at 7 as the highest level. When an interrupt is generated, the interrupt controller sends the priority of that interrupt to the CPU. If multiple interrupts is generated simultaneously, the interrupt controller sends the interrupt with the highest priority to the CPU. (The highest priority is level 7 using for non-maskable interrupts.) The CPU compares the priority level of the interrupt with the value of the CPU interrupts mask register . If the priority level of the interrupt is higher than the value of the interrupt mask register, the CPU accepts the interrupt. The interrupt mask register value can be updated using the value of the EI instruction (EI num sets data to num). For example, specifying "EI3" enables the maskable interrupts which priority level set in the interrupt controller is 3 or higher, and also non-maskable interrupts. Operationally, the DI instruction ( = 7) is identical to the EI7 instruction. DI instruction is used to disable maskable interrupts because of the priority level of maskable interrupts is 1 to 6. The EI instruction is valid immediately after execution. In addition to the above general-purpose interrupt processing mode, TLCS-900/H1 has a micro DMA interrupt processing mode as well. The CPU can transfer the data (1/2/4 bytes) automatically in micro DMA mode, therefore this mode is used for speed-up interrupt processing, such as transferring data to the internal or external peripheral I/O. Moreover, TMP92CM22 has software start function for micro DMA processing request by the software not by the hardware interrupt. Figure 3.4.1 shows the overall interrupt processing flow.
92CM22-29
2007-02-16
TMP92CM22
Interrupt processing
Interrupt specified by micro DMA start vector? No Interrupt vector "V" read Interrupt request F/F clear General-purpose interrupt processing PUSH PC PUSH SR SR Level of accepted interrupt + 1 INTNEST INTNEST + 1
Yes
Micro DMA soft start request Clear interrupt request flag
Data transfer by micro DMA Micro DMA processing COUNT COUNT - 1
COUNT = 0 No
Yes
Generating INTTC interrupt clear micro DMA start vector
PC(FFFF00H) + V)
Interrupt process program
RETI instruction POP SR POP PC INTNEST INTNEST-1
End
Figure 3.4.1 Interrupt and Micro DMA Processing Sequence
92CM22-30
2007-02-16
TMP92CM22 3.4.1 General-purpose Interrupt Processing
When the CPU accepts an interrupt, it usually performs the following sequence of operations. That is also the same as TLCS-900/L, TLCS-900/H, and TLCS-900/L1. (1) The CPU reads the interrupt vector from the interrupt controller. If the same level interrupts occur simultaneously, the interrupt controller generates an interrupt vector in accordance with the default priority and clears the interrupt request. (The default priority is already fixed for each interrupt: The smaller vector value has the higher priority level.) (2) The CPU pushes the value of program counter (PC) and status register (SR) onto the stack area (indicated by XSP). (3) The CPU sets the value which is the priority level of the accepted interrupt plus 1 (+1) to the interrupt mask register . However, if the priority level of the accepted interrupt is 7, the register's value is set to 7. (4) The CPU increases the interrupt nesting counter INTNEST by 1 (+1). (5) The CPU jumps to the address indicated by the data at address "FFFF00H + Interrupt vector" and starts the interrupt processing routine. When the CPU completed the interrupt processing, use the RETI instruction to return to the main routine. RETI restores the contents of program counter (PC) and status register (SR) from the stack and decreases the interrupt nesting counter INTNEST by 1(-1). Non-maskable interrupts cannot be disabled by a user program. Maskable interrupts, however, can be enabled or disabled by a user program. A program can set the priority level for each interrupt source. (A priority level setting of 0 or 7 will disable an interrupt request.) If an interrupt request which has a priority level equal to or greater than the value of the CPU interrupt mask register comes out, the CPU accepts its interrupt. Then, the CPU interrupt mask register is set to the value of the priority level for the accepted interrupt plus 1(+1). Therefore, if an interrupt is generated with a higher level than the current interrupt during it's processing, the CPU accepts the later interrupt and goes to the nesting status of interrupt processing. Moreover, if the CPU receives another interrupt request while performing the said (1) to (5) processing steps of the current interrupt, the latest interrupt request is sampled immediately after execution of the first instruction of the current interrupt processing routine. Specifying DI as the start instruction disables maskable interrupt nesting. A reset initializes the interrupt mask register to "7", disabling all maskable interrupts. Table 3.4.1 shows the TMP92CM22 interrupt vectors and micro DMA start vectors. The address FFFF00H to FFFFFFH (256 bytes) is assigned for the interrupt vector area.
92CM22-31
2007-02-16
TMP92CM22
Table 3.4.1 TMP92CM22 Interrupt Vectors and Micro DMA Start Vectors Default Priority
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 Maskable Nonmaskable
Type
Interrupt Source
Reset or "SWI0" instruction "SWI1" instruction "Illegal instruction" or "SWI2" instruction "SWI3" instruction "SWI4" instruction "SWI5" instruction "SWI6" instruction "SWI7" instruction NMI: External interrupt input pin INTWD: Watchdog Timer Micro DMA (Note 2) INT0: External interrupt input pin INT1: External interrupt input pin INT2: External interrupt input pin INT3: External interrupt input pin (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) INTP0: Protect 0 (WR to SFR) (Reserved) INTTA0: 8-bit timer 0 INTTA1: 8-bit timer 1 INTTA2: 8-bit timer 2 INTTA3: 8-bit timer 3 INTTB00: 16-bit timer 0 INTTB01: 16-bit timer 0 (Reserved) (Reserved) INTTBO0: 16-bit timer 0 (Overflow) (Reserved) INTRX0: Serial 0 (SIO0) receive INTTX0: Serial 0 (SIO0) transmission INTRX1: Serial 1 (SIO1) receive INTTX1: Serial 1 (SIO1) transmission (Reserved) (Reserved) (Reserved) (Reserved) (Reserved) INT4: External interrupt input pin INT5: External interrupt input pin INTTB10: 16-bit timer 1 INTTB11: 16-bit timer 1 INTTBO1: 16-bit timer 1 (Overflow) (Reserved) INTSBE0: SBI I C bus transfer end (Channel 0) (Reserved) (Reserved) (Reserved)
2
Vector Value
0000H 0004H 0008H 000CH 0010H 0014H 0018H 001CH 0020H 0024H - 0028H 002CH 0030H 0034H 0038H 003CH 0040H 0044H 0048H 004CH 0050H 0054H 0058H 005CH 0060H 0064H 0068H 006CH 0070H 0074H 0078H 007CH 0080H 0084H 0088H 008CH 0090H 0094H 0098H 009CH 00A0H 00A4H 00A8H 00ACH 00B0H 00B4H 00B8H 00BCH 00C0H 00C4H 00C8H
Address Refer to Vector
FFFF00H FFFF04H FFFF08H FFFF0CH FFFF10H FFFF14H FFFF18H FFFF1CH FFFF20H FFFF24H - FFFF28H FFFF2CH FFFF30H FFFF34H FFFF38H FFFF3CH FFFF40H FFFF44H FFFF48H FFFF4CH FFFF50H FFFF54H FFFF58H FFFF5CH FFFF60H FFFF64H FFFF68H FFFF6CH FFFF70H FFFF74H FFFF78H FFFF7CH FFFF80H FFFF84H FFFF88H FFFF8CH FFFF90H FFFF94H FFFF98H FFFF9CH FFFFA0H FFFFA4H FFFFA8H FFFFACH FFFFB0H FFFFB4H FFFFB8H FFFFBCH FFFFC0H FFFFC4H FFFFC8H
Micro DMA Start Vector
- 0AH (Note 1) 0BH (Note 1) 0CH (Note 1) 0DH (Note 1) 0EH 0FH 10H 11H 12H 13H 14H 15H 16H 17H 18H 19H 1AH 1BH 1CH 1DH 1EH 1FH 20H (Note 1) 21H 22H (Note 1) 23H 24H 25H 26H 27H 28H 29H 2AH 2BH 2CH 2DH 2EH 2FH 30H 31H 32H
92CM22-32
2007-02-16
TMP92CM22
Address Refer to Vector
FFFFCCH FFFFD0H FFFFD4H FFFFD8H FFFFDCH FFFFE0H FFFFE4H FFFFE8H FFFFECH FFFFF0H : FFFFFCH
Default Priority
52 53 54 55 56 57 58 59 60
Type
Interrupt Source
INTAD: AD conversion end INTTC0: Micro DMA end (Channel 0) INTTC1: Micro DMA end (Channel 1) INTTC2: Micro DMA end (Channel 2) INTTC3: Micro DMA end (Channel 3)
Vector Value
00CCH 00D0H 00D4H 00D8H 00DCH 00E0H 00E4H 00E8H 00ECH 00F0H : 00FCH
Micro DMA Start Vector
33H 34H 35H 36H 37H 38H 39H 3AH 3BH -
Maskable
INTTC4: Micro DMA end (Channel 4) INTTC5: Micro DMA end (Channel 5) INTTC6: Micro DMA end (Channel 6) INTTC7: Micro DMA end (Channel 7) (Reserved)
Note 1 : When initiating initiating micro DMA, set at edge detect mode. Note 2 : Micro DMA default priority. Micro DMA initiation takes priority over other maskable interrupts
92CM22-33
2007-02-16
TMP92CM22 3.4.2 Micro DMA
In addition to general-purpose interrupt processing, the TMP92CM22 also includes a micro DMA function. Micro DMA processing for interrupt requests set by micro DMA is performed at the highest priority level for maskable interrupts (Level 6), regardless of the priority level of the interrupt source. Because the micro DMA function is implemented through the CPU, when the CPU is placed in a stand-by state by a Halt instruction, the requirements of the micro DMA will be ignored (pending). Micro DMA is supports 8 channels and can be transferred continuously by specifying the micro DMA burst function as below. (1) Micro DMA operation When an interrupt request is generated by an interrupt source specified by the micro DMA start vector register, the micro DMA triggers a micro DMA request to the CPU at interrupt priority level 6 and starts processing the request. The eight micro DMA channels allow micro DMA processing to be set for up to eight types of interrupt at once. When micro DMA is accepted, the interrupt request flip-flop assigned to that channel is cleared. Data in one-byte, two-byte or four-byte blocks, is automatically transferred at once from the transfer source address to the transfer destination address set in the control register, and the transfer counter is decremented by 1. If the value of the counter after it has been decremented is not 0, DMA processing ends with no change in the value of the micro DMA start vector register. If the value of the decremented counter is 0, a micro DMA transfer end interrupt (INTTC0 to INTTC7) is sent from the CPU to the interrupt controller. In addition, the micro DMA start vector register is cleared to 0, the next micro DMA operation is disabled and micro DMA processing terminates. If micro DMA requests are set simultaneously for more than one channel, priority is not based on the interrupt priority level but on the channel number: the lower the channel number, the higher the priority (channel 0 thus has the highest priority and channel 7 the lowest). If an interrupt request is triggered for the interrupt source in use during the interval between the time at which the micro DMA start vector is cleared and the next setting, general purpose interrupt processing is performed at the interrupt level set. Therefore, if the interrupt is only being used to initiate micro DMA (and not as a general-purpose interrupt), the interrupt level should first be set to 0 (i.e., interrupt requests should be disabled). If micro DMA and general purpose interrupts are being used together as described above, the level of the interrupt which is being used to initiate micro DMA processing should first be set to a lower value than all the other interrupt levels. (Note) In this case, edge triggered interrupts are the only kinds of general interrupts which can be accepted.
Note: If the priority level of micro DMA is set higher than that of other interrupts, CPU operates as follows. In case INTxxx interrupt is generated first and then INTyyy interrupt is generated between checking "Interrupt specified by micro DMA start vector" (in theFigure 3.4.1) and reading interrupt vector with setting below. The vector shifts to that of INTyyy at the time. This is because the priority level of INTyyy is higher than that of INTxxx. In the interrupt routine, CPU reads the vector of INTyyy because cheking of micro DMA has finished. And INTyyy is generated regardless of transfer counter of micro DMA. INTxxx: level 1 without micro DMA INTyyy: level 6 with micro DMA
92CM22-34
2007-02-16
TMP92CM22
Although the control registers used for setting the transfer source and transfer destination addresses are 32 bits wide, this type of register can only output 24-bit addresses. Accordingly, micro DMA can only access 16 Mbytes (the upper eight bits of a 32-bit address are not valid). Three micro DMA transfer modes are supported: one-byte transfers, two-byte (one-word) transfer and four-byte transfer. After a transfer in any mode, the transfer source and transfer destination addresses will either be incremented or decremented, or will remain unchanged. This simplifies the transfer of data from memory to memory, from I/O to memory, from memory to I/O, and from I/O to I/O. For details of the various transfer modes, see section 3.4.2 (1), detailed description of the transfer mode register. Since a transfer counter is a 16-bit counter, up to 65536 micro DMA processing operations can be performed per interrupt source (provided that the transfer counter for the source is initially set to 0000H). Micro DMA processing can be initiated by any one of 34 different interrupts - the 33 interrupts shown in the micro DMA start vectors in Table 3.4.1 and a micro DMA soft start. Figure 3.4.2 shows a 2-byte transfer carried out using a micro DMA cycle in transfer destination address INC mode (micro DMA transfers are the same in every mode except counter mode). (The conditions for this cycle are as follows: Both source and destination memory are internal RAM and multiples by 4 numbered source and destination addresses.)
1 state a. CLK A0 to A23 src dst b. c. d. e.
Figure 3.4.2 Timing for Micro DMA Cycle
States 1 to 2:
Instruction fetches cycle (Gets next address code). If the instruction queue buffer is FULL , this cycle becomes a dummy cycle.
State 3: State 4: State 5:
Micro DMA read cycle. Micro DMA writes cycle. (The same as in state 1, 2.)
92CM22-35
2007-02-16
TMP92CM22
(2) Soft start function In addition to starting the micro DMA function by interrupts, TMP92CM22 includes a micro DMA software start function that starts micro DMA on the generation of the write cycle to the DMAR register. Writing "1" to each bit of DMAR register causes micro DMA once (If write "0" to each bit, micro DMA doesn't operate). At the end of transfer, the corresponding bit of the DMAR register is automatically cleared to "0". Only one channel can be set for DMA request at once. (Do not write 1 to more than one bit.) When writing again 1 to the DMAR register, check whether the bit is 0 before writing 1. If read "1", micro DMA transfer isn't started yet. When a burst is specified by DMAB register, data is continuously transferred until the value in the micro DMA transfer counter is "0" after start up of the micro DMA. If execatee soft start during micro DMA transfer by interrupt source, micro DMA transfer counter doesn't change. Don't use Read-modify-write instruction to avoid writign to other bits by mistake. Symbol Name
DMA request
Address
109H (Prohibit RMW)
7
DREQ7
6
DREQ6
5
DREQ5
4
DREQ4 R/W
3
DREQ3
2
DREQ2
1
DREQ1
0
DREQ0
DMAR
0
0
0
0
0
0
0
0
1: DMA request in software
(3) Transfer control registers The transfer source address and the transfer destination address are set in the following registers. Data setting for these registers is done by an "LDC cr, r" instruction.
Channel 0 DMAS0 DMAD0 DMAC0 DMAM0 DMA Source address register 0: only use LSB 24 bits. DMA Destination address register 0: only use LSB 24 bits. DMA Counter register 0: 1 to 65536. DMA Mode register 0.
Channel 7 DMAS7 DMAD7 DMAC7 DMAM7 8 bits 16 bits 32 bits DMA Source address register 7. DMA Destination address register 7. DMA Counter register 7. DMA Mode register 7.
92CM22-36
2007-02-16
TMP92CM22
(4) Detailed description of the transfer mode register
0 0 0 Mode DMAM0 to DMAM7
DMAM [4:0]
000 zz Destination address INC mode (DMADn +) (DMASn) DMACn DMACn - 1 If DMACn = 0 then INTTC Source address DEC mode (DMADn -) (DMASn) DMACn DMACn - 1 If DMACn = 0 then INTTC Source address INC mode (DMADn) (DMASn +) DMACn DMACn - 1 If DMACn = 0 then INTTC Source address DEC mode (DMADn) (DMASn -) DMACn DMACn - 1 If DMACn = 0 then INTTC Source address INC mode (DMADn +) (DMASn +) DMACn DMACn - 1 If DMACn = 0 then INTTC Source address DEC mode (DMADn -) (DMASn -) DMACn DMACn - 1 If DMACn = 0 then INTTC Destination address fixed mode (DMADn) (DMASn) DMACn DMACn - 1 If DMACn = 0 then INTTC Counter mode DMASn DMASn + 1 DMACn DMACn - 1 If DMACn = 0 then INTTC
Operation
Execution Time
5 states
001 zz
5 states
010 zz
5 states
011 zz
5 states
100 zz
6 states
101 zz
6 states
110 zz
5 states
111 00
5 states
ZZ
: 00 = 1-byte transfer : 01 = 2-byte transfer : 10 = 4-byte transfer : 11 = (Reserved)
Note 1: The execution state number shows number of best case (1-state memory access). 1 state = 50 ns (at internal 20 MHz) Note 2: "n" shows micro DMA channel number (0 to 7).
92CM22-37
2007-02-16
TMP92CM22 3.4.3 Interrupt Controller Operation
The block diagram in Figure 3.4.3 shows the interrupt circuits. The left-hand side of the diagram shows the interrupt controller circuit. The right-hand side shows the CPU interrupt request signal circuit and the halt release circuit. For each of the 33 interrupts channels there is an interrupt request flag (Consisting of a flip-flop), an interrupt priority setting register and a micro DMA start vector register. The interrupt request flag latches interrupt requests from the peripherals. The flag is cleared to 0 in the following cases: When reset occurs When the CPU reads the channel vector after accepted its interrupt When executing an instruction that clears the interrupt (Write DMA start vector to INTCLR register) When the CPU receives a micro DMA request When the micro DMA burst transfer is terminated An interrupt priority can be set independently for each interrupt source by writing the priority to the interrupt priority setting register (e.g., INTE0AD or INTE12). 6 interrupt priorities levels (1 to 6) are provided. Setting an interrupt source's priority level to 0 (or 7) disables interrupt requests from that source. If interrupt request with the same level are generated at the same time, the default priority (The interrupt with the lowest priority or, in other words, the interrupt with the lowest vector value) is used to determine which interrupt request is accepted first. The 3rd and 7th bits of the interrupt priority setting register indicate the state of the interrupt request flag and thus whether an interrupt request for a given channel has occurred. The interrupt controller sends the interrupt request with the highest priority among the simultaneous interrupts and its vector address to the CPU. The CPU compares the priority value in the status register by the interrupt request signal with the priority value set; if the latter is higher, the interrupt is accepted. Then the CPU sets a value higher than the priority value by 1 (+1) in the CPU SR. Interrupt request where the priority value equals or is higher than the set value are accepted simultaneously during the previous interrupt routine. When interrupt processing is completed (after execution of the RETI instruction), the CPU restores the priority value saved in the stack before the interrupt was generated to the CPU SR. The interrupt controller also has registers (8 channels) used to store the micro DMA start vector. Writing the start vector of the interrupt source for the micro DMA processing (See Table 3.4.1), enables the corresponding interrupt to be processed by micro DMA processing. The values must be set in the micro DMA parameter register (e.g., DMAS and DMAD) prior to the micro DMA processing.
92CM22-38
2007-02-16
Interrupt controller Interrupt request flag S Q 1 Interrupt request signal to CPU Priority encoder 1 3 3 Interuupt level detect Interrupt request signal 7 6
INTRQ2 to 0 IFF 2 to 0 then1
CPU
(Reserved)
Reset Interrupt vector read R IFF2:0 EI1 to 7 DI V = 20H V = 24H Decoder Y1 A Y2 Y3 B Y4 Y5 C Y6 6 Dn + 3 D1 36 D2 D3 Interrupt vector generator D4 D5 D6
Release halt
Interrupt enable flag in CPU side Reset
INTWD
Priority setting register Dn Dn + 1 D Q Dn + 2 CLR Interrupt request flag S Q R
INT0
Reset
1 2 A INTRQ2 to 0 3 Highest B 4 priority interrupt C 3 level select 5 6 (Highest priority is "7".) 7 D0
INT1 INT2 INT3
During IDLE1 During STOP
Figure 3.4.3 Block Diagram of Interrupt Controller
Interrupt request F/F read Interrupt vector read Micro DMA acknowlege V = 28H V = 2CH V = 30H V = 34H V = 38H V = 3CH V = 40H V = 44H V = 48H V = 4CH
92CM22-39
D7 V = D0H V = D4H V = D8H V = DCH V = E0H V = E4H V = E8H V = ECH Soft start 34 S
Selector
0
(Reserved) (Reserved) (Reserved) (Reserved) (Reserved) (Reserved)
Micro DMA counter 0 interrupt
INTTC0 INTTC1 INTTC2 INTTC3 INTTC4 INTTC5 INTTC6 INTTC7 4 4-input OR
Interrupt vector V read
RESET INT0 to INT3 NMI
Micro DMA start vector setting register
Micro DMA request
D 6 CLR INTTC0
Q
If IFF = 7 then 0 A
1 2 3
D5 D4 D3 D2 D1 D0
2 B DMA0V DMA1V DMA2V DMA3V Micro DMA channel priority encoder
2
TMP92CM22
2007-02-16
Reset
Micro DMA channel specification
TMP92CM22
(1) Interrupt priority setting registers
Symbol Name INT1&INT2 enable Address 7 I2C R 0 INT3 enable - - 0 - INTE3 D1H - - - Note: Always write "0". INTTA1 (TMRA1) INTETA01 INTTA0& INTTA1 enable D4H ITA1C R 0 INTTA2& INTTA3 enable ITA3C R 0 INTTB00& INTTB01 enable ITB01C R 0 INTTBO0 (Overflow) enable - R 0 - INTETBO0 DAH - - R/W Note: Always write "0". INTTX0 INTES0 INTRX0& INTTX0 enable DBH ITX0C R 0 INTRX1& INTTX1 enable ITX1C R 0 INT4& INT5 enable I5C R 0 INTTB10& INTTB11 enable ITB11C R 0 INTTBO1 (Overflow) enable - - - INTESB0 INTSBE0 enable E3H - - - INTEP0 INTP0 enable EEH - - - - - Note: Always write "0". - IP0C R 0 0 - - - Note: Always write "0". - ISBE0C R 0 0 INTP0 IP0M2 IP0M1 R/W 0 0 IP0M0 0 - INTETBO1 E2H - - - Note: Always write "0". - ITBO1C R 0 0 INTSBE0 ISBE0M2 ISBE0M1 R/W 0 0 ISBE0M0 0 ITB11M2 0 INT5 INTE45 E0H I5M2 I5M1 R/W 0 ITB11M1 R/W 0 0 0 ITB11M0 INTTB11 (TMRB1) INTETB1 E1H ITB10C R 0 0 I5M0 I4C R 0 0 ITB10M2 I4M2 0 INTTX1 INTES1 DCH ITX1M2 ITX1M1 R/W 0 0 ITX1M0 IRX1C R 0 0 INT4 I4M1 R/W 0 ITB10M1 R/W 0 0 INTTBO1 (TMRB1) ITBO1M2 ITBO1M1 ITBO1M0 R/W 0 0 0 ITB10M0 INTTB10 (TMRB1) I4M0 ITX0M2 ITX0M1 R/W 0 0 ITX0M0 IRX0C R 0 0 INTRX1 IRX1M2 IRX1M1 R/W 0 0 IRX1M0 - ITBO0C R 0 0 INTRX0 IRX0M2 IRX0M1 R/W 0 0 IRX0M0 0 ITB01M2 0 ITA3M2 ITA1M2 ITA1M1 R/W 0 ITA3M1 R/W 0 ITB01M1 R/W 0 0 0 ITB01M0 INTTB01 (TMRB0) INTETB0 D8H ITB00C R 0 0 0 ITA3M0 INTAT3 (TMRA3) D5H ITA2C R 0 0 ITB00M2 ITA1M0 ITA0C R 0 0 ITA2M2 - I3C R 0 0 ITA0M2 I3M2 6 INT2 INTE12 D0H I2M2 I2M1 R/W 0 0 I2M0 I1C R 0 0 INT3 I3M1 R/W 0 ITA0M1 R/W 0 ITA2M1 R/W 0 ITB00M1 R/W 0 0 INTTBO0 (TMRB0) ITBO0M2 ITBO0M1 ITBO0M0 R/W 0 0 0 ITB00M0 INTTB00 (TMRB0) 0 ITA2M0 INTAT2 (TMRA2) 0 ITA0M0 INTTA0 (TMRA0) I3M0 I1M2 5 4 3 2 INT1 I1M1 R/W 0 0 I1M0 1 0
INTETA23
92CM22-40
2007-02-16
TMP92CM22
Symbol
Name INT0&INTAD enable
Address
7 IADC R 0
6 INTAD IADM2 0 ITC1M2 0 ITC3M2 0 ITC5M2 0 ITC7M2 0 - -
5 IADM1 R/W 0 ITC1M1 R/W 0 ITC3M1 R/W 0 ITC5M1 R/W 0 ITC7M1 R/W 0 - -
4 IADM0 0 ITC1M0 0 ITC3M0 0 ITC5M0 0 ITC7M0 0 -
3 I0C R 0 ITC0C R 0 ITC2C R 0 ITC4C R 0 ITC6C R 0 ITCWD R 0
2 INT0 I0M2 0 ITC0M2 0 ITC2M2 0 ITC4M2 0 ITC6M2 0 INTWD - -
1 I0M1 R/W 0 ITC0M1 R/W 0 ITC2M1 R/W 0 ITC4M1 R/W 0 ITC6M1 R/W 0 - - -
0 I0M0 0 ITC0M0 0 ITC2M0 0 ITC4M0 0 ITC6M0 0 - -
INTE0AD
F0H
INTTC1 (DMA1) INTETC01 INTTC0& INTTC1 enable F1H ITC1C R 0 INTTC2& INTTC3 enable ITC3C R 0 INTTC4& INTTC5 enable ITC5C R 0 INTTC6& INTTC7 enable ITC7C R 0 INTWD enable - -
INTTC0 (DMA0)
INTTC3 (DMA3) INTETC23 F2H
INTTC2 (DMA2)
INTTC5 (DMA5) INTETC45 F3H
INTTC4 (DMA4)
INTTC7 (DMA7) INTETC67 F4H
INTTC6 (DMA6)
INTWDT
F7H
Note: Always write "0". Interrupt request flag
IxxM2
0 0 0 0 1 1 1 1
IxxM1
0 0 1 1 0 0 1 1
IxxM0
0 1 0 1 0 1 0 1
Function (Write)
Disables interrupt request. Sets interrupt priority level to 1. Sets interrupt priority level to 2. Sets interrupt priority level to 3. Sets interrupt priority level to 4. Sets interrupt priority level to 5. Sets interrupt priority level to 6. Disables interrupt request.
92CM22-41
2007-02-16
TMP92CM22
(2) External interrupt control
Symbol Name Address 7 6 5 I3EDGE 0 IIMC Interrupt input mode control 00F6H (Prohibit RMW) 4 I2EDGE W 0 0 0 0 INT3EDGE INT2EDGE INT1EDGE INT0EDGE INT0 0: Rising/ 0: Rising/ 0: Rising/ 0: Rising/ 0: Edge high high high high 1: Level 1: Falling/ 1: Falling/ 1: Falling/ 1: Falling/ low low low low 3 I1EDGE 2 I0EDGE 1 I0LE R/W 0 NMI 0: Falling edge 1: Falling and rising edges 0 NMIREE
I3LE Interrupt input mode control2 00FAH (Prohibit RMW) 0 INT3 0: Edge 1: Level
I2LE W 0 INT2 0: Edge 1: Level
I1LE 0 INT1 0: Edge 1: Level
IIMC2
H level L level Level edge Rising Falling
Detect edge
IxEDGE
IxLE
Note 1:
Disable INT0 to INT3 before changing INT0 to 3 pins mode from "level" to "edge".
Setting example for case of INT0: DI LD (IIMC) ,XXXXXX0-B LD (INTCLR),0AH NOP NOP NOP EI X: Don't care, -: No change ; ; ; Change from "level" to "edge". Clear interrupt request flag. Wait EI execution.
Note 2: Note 3:
See electrical characteristics in section 4 for external interrupt input pulse width. When release halt by INT0 to INT3 interrupt of level-mode in interrupt request enable, keep setting level by until be started interrupt process. If changed "level" before interrupt process starting, interrupt isn't processed correctly.
Example:
Case of set "H" level interrupt ( = 1, = 0). Keep "H" level until be started interrupt process. If changed to "L" level before interrupt process starting, interrupt isn't processed correctly.
92CM22-42
2007-02-16
TMP92CM22
Table 3.4.2 Function Setting of External Interrupt Pin Interrupt Pin Shared Pin Mode
Rising edge INT0 PC3 Falling edge High level Low level Rising edge INT1 PC1 Falling edge High level Low level Rising edge INT2 PC5 Falling edge High level Low level Rising edge INT3 PC6 Falling edge High level Low level INT4 INT5 PD0 PD1 Rising edge Falling edge Rising edge
Setting Method
IIMC = 0, INT0EDGE = 0 IIMC = 0, INT0EDGE = 1 IIMC = 1, INT0EDGE = 0 IIMC = 1, INT0EDGE = 1 IIMC2 = 0, INT1EDGE = 0 IIMC2 = 0, INT1EDGE = 1 IIMC2 = 1, INT1EDGE = 0 IIMC2 = 1, INT1EDGE = 1 IIMC2 = 0, INT2EDGE = 0 IIMC2 = 0, INT2EDGE = 1 IIMC2 = 1, INT2EDGE = 0 IIMC2 = 1, INT2EDGE = 1 IIMC2 = 0, INT3EDGE = 0 IIMC2 = 0, INT3EDGE = 1 IIMC2 = 1, INT3EDGE = 0 IIMC2 = 1, INT3EDGE = 1 TB1MOD = 0, 0 or 0,1 or 1, 0 TB1MOD = 1, 0 -
92CM22-43
2007-02-16
TMP92CM22
(3) SIO receive interrupt control Symbol Name
SIO SIMC Interrupt mode control
Address
7
6
5
4
3
2
1
IR1LE W
0
IR0LE 1 0: INTRX0 edge mode 1: INTRX0 level mode
F5H (Prohibit RMW)
1 0: INTRX1 edge mode 1: INTRX1 level mode
*INTRX1 level enables 0 1 Detect edge INTRX1 "H" level INTRX1
*INTRX0 rising edge enable 0 1 Detect edge INTRX0 "H" Level INTRX0
92CM22-44
2007-02-16
TMP92CM22
(4) Interrupt request flag clear register The interrupt request flag is cleared by writing the appropriate micro DMA start vector, as given in Table 3.4.1, to the register INTCLR. For example, to clear the interrupt flag INT0, perform the following register operation after execution of the DI instruction. INTCLR 0AH Clears interrupt request flag INT0 Symbol Name
Interrupt clear control
Address
F8H (Prohibit RMW)
7
6
5
CLRV5
4
CLRV4 0
3
CLRV3 W 0
2
CLRV2 0
1
CLRV1 0
0
CLRV0 0
INTCLR
0
Interrupt clear
(5) Micro DMA start vector registers This register assigns micro DMA processing to which interrupt source. The interrupt source with a micro DMA start vector that matches the vector set in this register is assigned as the micro DMA start source. When the micro DMA transfer counter value reaches "0", the micro DMA transfer end interrupt corresponding to the channel is sent to the interrupt controller, the micro DMA start vector register is cleared, and the micro DMA start source for the channel is cleared. Therefore, to continue micro DMA processing, set the micro DMA start vector register again during the processing of the micro DMA transfer end interrupt. If the same vector is set in the micro DMA start vector registers of more than one channel, the channel with the lowest number has a higher priority. Accordingly, if the same vector is set in the micro DMA start vector registers of two channels, the interrupt generated in the channel with the lower number is executed until micro DMA transfer is completed. If the micro DMA start vector for this channel is not set again, the next micro DMA is started for the channel with the higher number (Micro DMA chaining).
92CM22-45
2007-02-16
TMP92CM22
Symbol
Name
DMA0
Address
7
6
5
DMA0V5
4
DMA0V4 0 DMA1V4 0 DMA2V4 0 DMA3V4 0 DMA4V4 0
3
DMA0V3 0 DMA1V3 0 DMA2V3 0 DMA3V3 0 DMA4V3 0 R/W
2
DMA0V2 0 DMA1V2 0 DMA2V2 0 DMA3V2 0 DMA4V2 0
1
DMA0V1 0 DMA1V1 0 DMA2V1 0 DMA3V1 0 DMA4V1 0
0
DMA0V0 0 DMA1V0 0 DMA2V0 0 DMA3V0 0 DMA4V0 0
DMA0V
start vector
100H
0 DMA1V5
DMA0 start vector DMA1 DMA1V start vector 101H R/W 0 DMA2V5 102H 0 DMA3V5 103H 0 DMA4V5 DMA4 DMA4V start vector 104H 0 DMA1 start vector DMA2 DMA2V start vector R/W DMA2 start vector DMA3 DMA3V start vector R/W DMA3 start vector R/W
DMA4 start vector DMA5V5 DMA5 DMA5V start vector 105H 0 0 0 DMA5V4 DMA5V3 DMA5V2 0 DMA5V1 0 DMA5V0 0 R/W DMA5 start vector DMA6V5 DMA6 DMA6V start vector 106H 0 0 0 DMA6V4 DMA6V3 DMA6V2 0 DMA6V1 0 DMA6V0 0
R/W DMA6 start vector DMA7V5 DMA7V4 0 DMA7V3 0 DMA7V2 0 DMA7V1 0 DMA7V0 0
DMA7 DMA7V start vector 107H 0
R/W DMA7 start vector
92CM22-46
2007-02-16
TMP92CM22
(6) Specification of a micro DMA burst Specifying the micro DMA burst function causes micro DMA transfer, once started, to continue until the value in the transfer counter register reaches 0. Setting any of the bits in the register DMAB which correspond to a micro DMA channel (as shown below) to 1 specifies that any micro DMA transfer on that channel will be a burst transfer. Symbol Name Address 7
DBST7 DMAB DMA burst 108H 0
6
DBST6 0
5
DBST5 0
4
DBST4 R/W 0
3
DBST3 0
2
DBST2 0
1
DBST1 0
0
DBST0 0
1: DMA request on burst mode
92CM22-47
2007-02-16
TMP92CM22
(7) Notes The instruction execution unit and the bus interface unit in this CPU operate independently. Therefore if, immediately before an interrupt is generated, the CPU fetches an instruction which clears the corresponding interrupt request flag (Note), the CPU may execute this instruction in between accepting the interrupt and reading the interrupt vector. In this case, the CPU will read the default vector 0004H and jump to interrupt vector address FFFF04H. To avoid this, an instruction which clears an interrupt request flag should always be placed after a DI instruction. And in the case of setting an interrupt enable again by EI instruction after the execution of clearing instruction, execute EI instruction after clearing and more than 3-instructions (e.g., "NOP"x 3 times). If placed EI instruction without waiting NOP instruction after execution of clearing instruction, interrupt will be enable before request flag is cleared. Thus, when be changed interrupt request level to "0", change it after cleared corresponding interrupt request by INTCLR instruction. In the case of changing the value of the interrupt mask register by execution, disable an interrupt by DI instruction before execution of POPSR instruction. In addition, please note that the following two circuits are exceptional and demand special attention.
In level mode INT0 to INT3 are not an edge-triggered interrupt. Hence, in level mode the interrupt request flip-flop for INT0 to INT3 does not function. The peripheral interrupt request passes through the S input of the flip-flop and becomes the Q output. If the interrupt input mode is changed from edge mode to level mode, the interrupt request flag is cleared automatically. If the CPU enters the interrupt response sequence as a result of INT x (x = 0, 1, 2, or 3) going from 0 to 1, INTx must then be held at 1 until the interrupt response sequence has been completed. If INTx is set to Level mode so as to release a Halt state, INTx must be held at 1 from the time INTx changes from 0 to 1 until the Halt state is released. (Hence, it is necessary to ensure that input noise is not interpreted as a 0, causing INTx to revert to 0 before the Halt state has been INT0 to INT3 level mode released.) When the mode changes from level mode to edge mode, interrupt request flags which were set in level mode will not be cleared. Interrupt request flags must be cleared using the following sequence. DI LD (IIMC), 00H NOP NOP NOP EI INTRX The interrupt request flip-flop can only be cleared by a reset or by reading the serial channel receive buffer. It cannot be cleared by writing INTCLR register. ; Changes from level to edge. ; Wait EI execution. LD (INTCLR), 0AH ; Clears interrupt request flag.
Note: The following instructions or pin input state changes are equivalent to instructions that clear the interrupt request flag. INT0 to INT 3: Instructions which switch to level mode after an interrupt request has been generated in edge mode. The pin input change from high to low after interrupt request has been generated in level mode. ("H" "L", "L" "H") INTRX: Instruction which read the receive buffer.
92CM22-48
2007-02-16
TMP92CM22
3.5
Port Function
The TMP92CM22 features 50-bit settings which relate to the various I/O ports. As well as general-purpose I/O port functionality, the port pins also have I/O functions which relate to the built-in CPU and internal I/Os. Table 3.5.1 lists the functions of each port pin. Table 3.5.2 and Table 3.5.3 lists I/O registers and their specifications. Table 3.5.1 Port Function (R: U = with pull-up resistor)
Port Names
Port 1 Port 4 Port 5 Port 6 Port 7
Pin Names
P10 to P17 P40 to P47 P50 to P57 P60 to P67 P70 P71 P72 P73 P74 P75 P76 P80 P81 P82 P83 P90 P91 P92 PA0 PA1 PA2 PA7 PC0 PC1 PC3 PC5 PC6 PD0 PD1 PD2 PD3 PF0 PF1 PF2 PF3 PF4 PF5 PF6 PF7 PG0 PG1 PG2 PG3 PG4 PG5 PG6 PG7
Number of Pins
8 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Direction
I/O I/O* I/O* I/O* Output Output Output Output Output Output I/O Output Output Output Output I/O I/O I/O Input Input Input Input I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O Input Input Input Input Input Input Input Input
R
- - - - - - - - - - - - - - - - - - U U U U - - - - - - - - - - - - - - - - - - - - - - - - -
Direction Setting Unit
Bit Bit* Bit* Bit* (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) Bit (Fixed) (Fixed) (Fixed) (Fixed) Bit Bit Bit (Fixed) (Fixed) (Fixed) (Fixed) Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed)
Pin Names for Built-In Function
D8 to D15 A0 to A7 A8 to A15 A16 to A23
RD WRLL
WRLU
CLKOUT R/ W
WAIT
Port 8
CS0 CS1 CS2 CS3
Port 9
SCK SO, SDA SI, SCL
Port A
Port C
Port D
Port F
TA0IN INT1, TA1OUT INT0 INT2, TA3OUT INT3, TB0OUT0 INT4, TB1IN0 INT5, TB1IN1 TB1OUT0 TB1OUT1 TXD0 RXD0 SCLK0, CTS0 TXD1 RXD1 SCLK1, CTS1
Port G
AN0 AN1 AN2 AN3, ADTRG AN4 AN5 AN6 AN7
*: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
92CM22-49
2007-02-16
TMP92CM22
Table 3.5.2 I/O Port Setting List (1/2) Ports
Port 1
Input Pins
P10 to P17 Input port Output port
Specification
I/O Register Setting Value Pn
x x x x x x x x x x x x x
PnCR PnFC PnODE
0 1 x 0* 1* x 0* 1* x 0* 1* x None 1 0 1 0 1 0 1 0 None None None 0 None
D8 to D15 bus Port 4 P40 to P47 Input port* Output port* A0 to A7 output Port 5 P50 to P57 Input port* Output port* A8 to A15 output Port 6 P60 to P67 Input port* Output port* A16 to A23 output Port 7 P70 to P75 P70 P71 P72 P74 P75 P76 Output port
RD output
WRLL output
WRLU output
x
None
1 None
CLKOUT output R/ W output Input port Output port
WAIT Input
x x x x x x x x x x x x x x x x
0 1 0
0 0 1 0 1
Port 8
P80 to P83 P80 P81 P82 P83
Output port
CS0 output CS1 output CS2 output CS3 output
None
1 1 1
None
Port 9
P90 to P92 P90 P91 P92
Input port Output port SCK input SCK output SO output SDA SI input SCL (Open drain)
0 1 0 x 1 x 0 x
0 0 0 1 1 1 0 1
0 0 0 0/1 0/1 1 0 1
X: Don't care *: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
92CM22-50
2007-02-16
TMP92CM22
Table 3.5.3 I/O Port Setting List (2/2) Ports
Port A Port C
Input Pins
PA0, PA1, PA2, PA7 PC0, PC1, PC3, PC5, PC6 PC0 PC1 PC3 PC5 PC6 Input port Input port Output port TA0IN input
Specification
I/O Register Setting Value Pn
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x None None None
PnCR
None 0 1 x 1 0 x 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0/1 0 0 1 0 0/1 0
PnFC PnODE
None 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 None 1 1 1 1 None 1 1 None None None None
TA1OUT output INT1 input INT0 input INT2 input TA3OUT INT3 input TB0OUT0 Input port Output port TB1IN0, INT4 input TB1IN1, INT5 input TB0OUT0 output TB0OUT1 output Input port Output port TXD0 (Open drain) TXD0 RXD0 input SCLK0 input/output
CTS0 input
Port D
PD0 to PD3 PD0 PD1 PD2 PD3
Port F
PF0 to PF7 PF0 PF1 PF2 PF3 PF4 PF5
TXD1 (Open drain) TXD1 RXD1 input SCLK1 input/output
CTS1 input
Port G
PG0 to PG7 PG3
Input port AN0 to AN7 input
ADTRG input
X: Don't care
By resetting, these port pins become general-purpose input port. I/O pin is reset to input pin. When use built-in function, process all function by software.
92CM22-51
2007-02-16
TMP92CM22 3.5.1 Port 1 (P10 to P17)
Port1 is an 8-bit general-purpose I/O port. Bits can be individually set as either inputs or outputs by control register P1CR and function register P1FC. In addition to functioning as a general-purpose I/O port, port1 can also function as a data bus (D8 to D15). After released reset, device set port1 to pins of follow function by combination of AM1 and AM0 pins.
AM1 AM0
0 0 1 1 0 1 0 1
Function Setting after Reset
Don't use this setting Data bus (D8 to D15) Input port (P10 to P17) Don't use this setting
Reset
Direction control (on bit basis)
P1CR write
Function control (on byte batch) Internal data bus
External access (Data write)
P1FC write S Output latch A Selector P1 write D8 to D15 Output buffer B Port 1 P10 to P17 (D8 to D15)
P1 Read
External access (Data read)
Figure 3.5.1 Port 1
92CM22-52
2007-02-16
TMP92CM22
Port 1 Register 7
P1 (0004H) Bit symbol Read/Write After reset P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Data from external port (Output latch register is clear to "0".)
Port 1 Control Register
P1CR (0006H)
7
Bit symbol Read/Write After reset Function 0 P17C
6
P16C 0
5
P15C 0
4
P14C W 0
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0
Refer to port 1 function setting
Port 1 Function Register 7
Bit symbol P1FC (0007H) Read/Write After reset Function Refer to port 1 function setting
6
5
4
3
2
1
0
P1F W 0/1 Note3
Port 1 Function setting Note 1: Read-modify-write instruction is prohibited for registers P1FC and P1CR. Note 2: shows "X bit" of P1CR register. Note 3: It is set to "Port" or "Data bus" by AM pin setting. P1CR 0 1 Input port Output port Data bus (D15 to D8) Don't use this setting P1FC 0 1
Figure 3.5.2 Register for Port 1
92CM22-53
2007-02-16
TMP92CM22 3.5.2 Port 4 (P40 to P47)
Port 4 is an 8-bit general-purpose I/O port*. Bits can be individually set as either inputs or outputs by control register P4CR and function register P4FC*. In addition to functioning as a general-purpose I/O port, port 4 can also function as a address bus (A0 to A7). After released reset, device set Port 4 to pins of follow function by combination of AM1 and AM0 pins. AM1
0 0 1 1
AM0
0 1 0 1
Function Setting after Reset
Don't use this setting Address bus (A0 to A7) Address bus (A0 to A7) Don't use this setting
Reset Internal address bus A0 to A7 Direction control (on bit basis)*
P4CR write Function control Internal data bus (on bit basis) S B P4FC write Selector Output latch A Output buffer Port 4 P40 to P47 (A0 to A7)
P4 write
P4 read
*: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.3 Port 4
92CM22-54
2007-02-16
TMP92CM22
7
P4 (0010H) Bit symbol Read/Write After reset P47
6
P46
5
Port 4 Register 4
P44 R/W
3
P43
2
P42
1
P41
0
P40
P45
Data from external port (Output latch register is cleared to "0".)
7
P4CR (0012H) Bit symbol Read/Write After reset Function 0 P47C
6
P46C 0
Port 4 Control Register 5 4 3
P45C 0 P44C W 0 0 P43C
2
P42C 0
1
P41C 0
0
P40C 0
0: Input 1: Output (Note2)
7
P4FC (0013H) Bit symbol Read/Write After reset Function 1 P47F
6
P46F 1
Port 4 Function Register 5 4 3
P45F 1 P44F W 1 1 P43F
2
P42F 1
1
P41F 1
0
P40F 1
0: Port 1: Address bus (A0 to A7)
Note1: Read-modify-write instruction is prohibited for registers P4CR and P4FC. Note2: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.4 Register for Port 4
92CM22-55
2007-02-16
TMP92CM22 3.5.3 Port 5 (P50 to P57)
Port 5 is an 8-bit general-purpose I/O port*. Bits can be individually set as either inputs or outputs by control register P5CR and function register P5FC*. In addition to functioning as a general-purpose I/O port, port 5 can also function as an address bus (A8 to A15). After released reset, device set port 5 to pins of follow function by combination of AM1 and AM0 pins. AM1
0 0 1 1
AM0
0 1 0 1
Function Setting after Reset
Don't use this setting Address bus (A8 to A15) Address bus (A8 to A15) Don't use this setting
Reset Internal address bus A8 to A15 Direction control (on bit basis)*
P5CR write
Internal data bus
Function control (on bit basis) S B P5FC write Selector Output latch A Output buffer Port 5 P50 to P57 (A8 to A15)
P5 write
P5 read
*: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.5 Port 5
92CM22-56
2007-02-16
TMP92CM22
7
P5 (0014H) Bit symbol Read/Write After reset P57
6
P56
5
Port 5 Register 4
P54 R/W
3
P53
2
P52
1
P51
0
P50
P55
Data from external port (Output latch register is cleared to "0".)
7
P5CR (0016H) Bit symbol Read/Write After reset Function 0 P57C
6
P56C 0
Port 5 Control Register 5 4 3
P55C 0 P54C W 0 0 P53C
2
P52C 0
1
P51C 0
0
P50C 0
0: Input 1: Output (Note2)
7
P5FC (0017H) Bit symbol Read/Write After reset Function 1 P57F
6
P56F 1
Port 5 Function Register 5 4 3
P55F 1 P54F W 1 1 P53F
2
P52F 1
1
P51F 1
0
P50F 1
0: Port 1: Address bus (A8 to A15)
Note1: Read-modify-write instruction is prohibited for registers P5CR and P5FC. Note2: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.6 Register for Port 5
92CM22-57
2007-02-16
TMP92CM22 3.5.4 Port 6 (P60 to P67)
Port 6 is an 8-bit general-purpose I/O port*. Bits can be individually set as either inputs or outputs by control register P6CR and function register P6FC*. In addition to functioning as a general-purpose I/O port, port 6 can also function as an address bus (A16 to A23). After released reset, device set port 6 to pins of follow function by combination of AM1 and AM0 pins. AM1
0 0 1 1
AM0
0 1 0 1
Function Setting after Reset
Don't use this setting Address bus (A16 to A23) Address bus (A16 to A23) Don't use this setting
Reset Internal address bus A16 to A23 Direction control (on bit basis)*
P6CR write
Internal data bus
Function control (on bit basis) S B P6FC write Selector Output latch A Output buffer Port 6 P60 to P67 (A16 to A23)
P6 write
P6 read
*: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.7 Port 6
92CM22-58
2007-02-16
TMP92CM22
Port 6 Register 7
P6 (0018H) Bit symbol Read/Write After reset P67
6
P66
5
P65
4
P64 R/W
3
P63
2
P62
1
P61
0
P60
Data from external port (Output latch register is cleared to "0".)
Port 6 Control Register 7
P6CR (001AH) Bit symbol Read/Write After reset Function 0 0 0 0 P67C
6
P66C
5
P65C
4
P64C W
3
P63C 0
2
P62C 0
1
P61C 0
0
P60C 0
0: Input 1: Output (Note2)
Port 6 Function Register 7
P6FC (001BH) Bit symbol Read/Write After reset Function 1 1 1 1 P67F
6
P66F
5
P65F
4
P64F W
3
P63F 1
2
P62F 1
1
P61F 1
0
P60F 1
0: Port 1: Address bus (A16 to A23)
Note1: Read-modify-write instruction is prohibited for registers P6CR and P6FC. Note2: When these ports are used as general-purpose I/O port, each bit can be set individually for input or output. However, each bit cannot be set individually for input or output even if 1bit or more bits are used as address bus in same port. All of general-purpose I/O ports except for port that used as address bus are operated as output port. Please be careful when using this setting.
Figure 3.5.8 Register for Port 6
92CM22-59
2007-02-16
TMP92CM22 3.5.5 Port 7 (P70 to P76)
Port 7 is a 7-bit general-purpose I/O port (P70 to P75 are used for output only). Bits can be individually set as either inputs or outputs by control register P7CR and function register P7FC. In addition to functioning as a general-purpose I/O port, P70 to P73 pins can also function as output pin of read/write strobe signals to connect with an external memory. P74 pin can also function as CLKOUT output pin when outputted internal clock. P76 pin can also function as wait input. After reset, P71 to P75 pins are set to output port mode, and P76 pin is set to input port mode. P70 pin set port 1 to pins of follow function by combination of AM1 and AM0 pins. AM1 0 0 1 1 AM0 0 1 0 1 Function Setting after Reset Don't use this setting CPU control pin ( RD ) CPU control pin ( RD ) Don't use this setting
Reset
Function control (on bit basis) Internal data bus
P7FC write S Output latch A Selector P7 write B Output buffer Port 7 P70 ( RD ) P71 ( WRLL ) P72 ( WRLU ) P73 P74 (CLKOUT) P75 (R/ W )
P7 read
RD , WRLL , WRLU , CLKOUT, R/ W
Note: P73 is fixed to VCC.
Figure 3.5.9 Port 7 (P70 to P75)
92CM22-60
2007-02-16
TMP92CM22
Reset
Direction control (on bit basis)
P7CR write
Internal data bus
Function control (on bit basis)
P7FC write S Output latch Output buffer P7 write Port P7 P76 ( WAIT )
P7 read Internal WAIT signal
Figure 3.5.10 Port 7 (P76) Port 7 Register 7
P7 (001CH) Bit symbol Read/Write After reset
Data from external port (Note)
6
P76
5
P75 1
4
P74 1
3
P73 R/W 1
2
P72 1
1
P71 1
0
P70 1
Note: Output latch register is cleared to 0.
Port 7 Control Register 7
P7CR (001EH) Bit symbol Read/Write After reset Function
6
P76C W 0 0: Input 1: Output
5
4
3
2
1
0
Port 7 Function Register 7
P7FC (001FH) Bit symbol Read/Write After reset Function 0 0: Port 1: WAIT 0 0: Port 1: R/ W 0 0: Port
6
P76F
5
P75F
4
P74F
3
P73F W 0 0: Port
2
P72F 0 0: Port
1
P71F 0 0: Port 1: WRLL
0
P70F 1 0: Port 1: RD
1: CLKOUT 1: Don't set 1: WRLU
Note: Read-modify-write instruction is prohibited for registers P7CR and P7FC.
Figure 3.5.11 Register for Port 7
92CM22-61
2007-02-16
TMP92CM22 3.5.6 Port 8 (P80 to P83)
Port 8 is 4-bit output port. Resetting sets output latch of P82 to "0" and set output latches of P80, P81, and P83 to "1". In addition to functioning as a output port, port 8 can also function as a output chip select signal ( CS0 to CS3 ). These settings operate by programming "1" to the corresponding bit of P8FC. Resetting set all bits of P8FC to "0", these pits set output mode.
Reset
Function control (on bit basis) Internal data bus
P8FC write S Output latch A Selector P8 write B P80 ( CS0 ) P81 ( CS1 ) P82 ( CS2 ) P83 ( CS3 )
P8 read
CS0 , CS1 , CS2 , CS3
Figure 3.5.12 Port 8
Port 8 Register 7
P8 (0020H) Bit symbol Read/Write After reset 1 0
6
5
4
3
P83
2
P82 R/W
1
P81 1
0
P80 1
Port 8 Function Register 7
Bit symbol P8FC (0023H) Read/Write After reset Function 0 0: Port 1: CS3 0 0: Port 1: CS2
6
5
4
3
P83F
2
P82F W
1
P81F 0 0: Port 1: CS1
0
P80F 0 0: Port 1: CS0
Note 1: Read-modify-write instruction is prohibited for the registers P8FC. Note 2: When set P82 pin as CS2 after release reset, set function register (P8FC = 1) in keep output latch of P82 to "0" (P8 = 0). If set function register (P8FC = 1) after set output latch to "1" (P8 = 1), maybe operation become to error because CS2 output don't output correctly.
Figure 3.5.13 Register for Port 8
92CM22-62
2007-02-16
TMP92CM22 3.5.7 Port 9 (P90 to P92)
Port 9 is 3-bit general-purpose I/O port. Each bit can be set individually for input or output. In addition to functioning as a general-purpose I/O port, port 9 can also function as a serial bus interface input (SCK (Clock signal in SIO mode), SO (Data output signal in SIO mode), SDA (Data signal in I2C bus mode), SI (Data input signal in SIO mode) and SCL (Clock signal in I2C bus mode)). These settings operate by programming to the corresponding bit of P9FC. Resetting set value of P9CR and P9FC to "0", all bits are set to input port. And all bits of output latch are set to "1".
Reset
Direction control (on bit basis)
P9CR write
Internal data bus
Function control (on bit basis)
P9FC write S Output latch
S A Selector B
P90 (SCK),
Open-drain enable P9ODE
P91 (SO/SDA) P92 (SI/SCL)
P9 write SCK output SO output SDA output SCL output
S B Selector A
P9 read SCK input SDA input SI/SCL input
Figure 3.5.14 Port 9 (P90 to P92)
92CM22-63
2007-02-16
TMP92CM22
Port 9 Register 7
P9 (0024H) Bit symbol Read/Write After reset
6
5
4
3
2
P92
1
P91 R/W
0
P90
Data from external port (Output latch register is set to 1)
Port 9 Control Register 7
P9CR (0026H) Bit symbol Read/Write After reset Function 0 0: Input
6
5
4
3
2
P92C
1
P91C W 0 1: Output
0
P90C 0
Port 9 Function Register 7
P9FC (0027H) Bit symbol Read/Write After reset Function 0 0: Port, SI 1: SCL Note
6
5
4
3
2
P92F
1
P91F W 0 0: Port 1: SO, SDA
0
P90F 0
0: Port, SCK input 1:SCK output Note
Port 9 ODE Register 7
P9ODE (0025H) Bit symbol Read/Write After reset Function 0
1:Open drain
6
5
4
3
2
P92ODE W
1
P91ODE 0
1:Open drain
0
Note1: Read-modify-write instruction is prohibited for the registers P9CR, P9FC, and P9ODE. Note2: When using SI and SCK input function, set P9FC to "0" (Function setting).
Figure 3.5.15 Register for Port 9
92CM22-64
2007-02-16
TMP92CM22 3.5.8 Port A (PA0 to PA2, PA7)
Port A is 4-bit general-purpose input port with pull-up resistor.
Pull-up resistor Internal data bus
PA0, PA1, PA2, PA7 PA read
Figure 3.5.16 Port A
Port A Register 7
PA (0028H) Bit symbol Read/Write After reset PA7 R
Data from external port
6
5
4
3
2
PA2
1
PA1 R Data from external port
0
PA0
Figure 3.5.17 Register for Port A
92CM22-65
2007-02-16
TMP92CM22 3.5.9 Port C (PC0, PC1, PC3, PC5, and PC6)
Port C is 5-bit general-purpose I/O port. Each bit can be set individually for input or output. Resetting sets port C to input port. In addition to functioning as a general-purpose I/O port, port C can also function as a input/output pin (TA0IN, TA1OUT, TA3OUT, and TB0OUT0) and external interrupt pin (INT0 to INT3). These settings operate by programming "1" to the corresponding bit of PCCR and PCFC. Resetting resets the PCCR and PCFC to "0", and sets all bits to input port. (1) PC0 (TA0IN) In addition to function as I/O port, port PC0 can also function as input pin TA0IN of timer channel 0.
Reset
Direction control (on bit basis)
PCCR write Internal data bus
Function control (on bit basis)
PCFC write S Output latch PC0 (TA0IN)
PC write
S B Selector A
PC read TA0IN
Note: Can not read the output latch data when output mode.
Figure 3.5.18 Port C (PC0)
92CM22-66
2007-02-16
TMP92CM22
(2) PC1 (INT1, TA1OUT), PC5 (INT2, TA3OUT), PC6 (INT3, TB0OUT0) In addition to function as I/O port, port PC1, PC5, and PC6 can also function as external interrupt input pin INT1 to INT3 and output pin of timer channel TA1OUT, TA3OUT, and TB0OUT0.
Reset
Direction control (on bit basis)
PCCR write
Function control (on bit basis)
Internal data bus
PCFC write S Output latch PC write TA1OUT TA3OUT TB0OUT0 S B Selector A S A Selector B
PC1 (INT1, TA1OUT) PC5 (INT2, TA3OUT) PC6 (INT3, TB0OUT0)
PC read INT1 INT2 INT3 A Selector S B
Select rising/falling
IIMC
High level/low level selection
IIMC2
Note: Can not read the output latch data when output mode.
Figure 3.5.19 Port C (PC1, PC5, and PC6)
92CM22-67
2007-02-16
TMP92CM22
(3) PC3 (INT0) In addition to function as I/O port, port PC3 can also function as external interrupt pin INT0.
Reset
Direction control (on bit basis)
PCCR write Internal data bus
Function control (on bit basis)
PCFC write S Output latch PC3 (INT0)
PC read S B Selector PC read INT0 A Select level/edge and Select rising/falling IIMC
Figure 3.5.20 Port C (PC3)
92CM22-68
2007-02-16
TMP92CM22
Port C Register 7
PC (0030H) Bit symbol Read/Write After reset
6
PC6 R/W
5
PC5
4
3
PC3 R/W
Data from external port (Note)
2
1
PC1 R/W
0
PC0
Data from external port (Note)
Data from external port (Note)
Note: Output latch register is set to 1.
Port C Control Register 7
PCCR (0032H) Bit symbol Read/Write After reset Function 0
6
PC6C W
5
PC5C 0
4
3
PC3C W 0 0: Input 1: Output
2
1
PC1C W 0
0
PC0C 0
0: Input 1: Output
0: Input 1: Output
Port C Function Register 7
PCFC (0033H) Bit symbol Read/Write After reset Function 0
0: Port 1: INT3 TB0OUT0
6
PC6F W
5
PC5F 0
0: Port 1: INT2 TA3OUT
4
3
PC3F W 1 0: Port 1: INT0
2
1
PC1F W 0 0: Port
1: INT1 TA1OUT
0
PC0F 0 0: Port 1: TA0IN
INT1, TA1OUT setting

0 Input port INT1
1 Output port TA1OUT
0 1
INT2, TA3OUT Setting

0 Input port INT2
1 Output port TA3OUT
0 1
INT3, TB0OUT0 setting

0 Input port INT3
1 Output port TB0OUT0
0 1
Note 1: Read-modify-write instruction is prohibited for the registers PCCR and PCFC. Note 2: PC0/TA0IN pins do not have a register changing PORT/FUNCTION. For example, when it is used as an input port, the input signal is inputted to 8-bit timer as the input 0. Note 3: Can not read the output latch data when PC0, PC1, PC5, and PC6 are output mode.
Figure 3.5.21 Register for Port C
92CM22-69
2007-02-16
TMP92CM22 3.5.10 Port D (PD0 to PD3)
Port D is 4-bit general-purpose I/O port. Each bit can be set individually for input or output. Resetting sets port D to input port. In addition to functioning as a general-purpose I/O port, port D can also function as an input pin (INT4 and INT5)/output pin (TB0IN, TB1OUT, TB3OUT, and TB1OUT1). These settings operate by programming "1" to the corresponding bit of PDCR and PDFC. Resetting resets the PDCR and PDFC to "0", and sets all bits to input port. (1) PD0 (INT4, TB1IN0), PD1 (INT5, TB1IN1) In addition to function as I/O port, port PD0 and PD1 can also function as external interrupt input pins INT4, INT5, timer channel input pins TB1IN0 and TB1IN1.
Reset
Direction control (on bit basis)
PDCR write Internal address bus
Function control (on bit basis)
PDFC write S Output latch PD0 (INT4, TB1IN0) PD1 (INT5, TB1IN1)
PD write S B Selector PD read INT4, TB1IN0 INT5, TB1IN1 A
Note: Can not read the output latch data when output mode.
Figure 3.5.22 Port D (PD0 and PD1)
92CM22-70
2007-02-16
TMP92CM22
(2) PD2 (TB1OUT0) and PD3 (TB1OUT1) In addition to function as I/O port, port PD0 and PD1 can also function as timer channel output pins TB1OUT0 and TB1OUT1.
Reset
Direction control (on bit basis)
PDCR write Internal data bus
Function control (on bit basis)
PDFC write S Output latch
S A Selector B S B Selector A
PD2 (TB1OUT0) PD3 (TB1OUT1)
PD write TB1OUT0 TB1OUT1 PF read
Figure 3.5.23 Port D (PD2 and PD3)
92CM22-71
2007-02-16
TMP92CM22
Port D Register 7
PD (0034H) Bit symbol Read/Write After reset
6
5
4
3
PD3
2
PD2 R/W
1
PD1
0
PD0
Data from external port (Output latch register is set to 1)
Port D Control Register 7
PDCR (0036H) Bit symbol Read/Write After reset Function 0 0: Input 1: Output 0 0: Input 1: Output
6
5
4
3
PD3C
2
PD2C W
1
PD1C 0 0: Input 1: Output
0
PD0C 0 0: Input 1: Output
Port D I/O setting 0 1 Input Output
7
PDFC (0037H) Bit symbol Read/Write After reset Function
6
Port D Function Register 5 4 3
PD3F 0
2
PD2F W 0
1
PD1F 0
0
PD0F 0
0: Port 1: TB0IN0 INT4 Input
0: Port 0: Port 0: Port 1: TB1OUT1 1: TB1OUT0 1: TB0IN1 INT5 Input
PD2 output setting asTB1OUT0 PDFC 1
PDCR 1 PD3 output setting as TB1OUT1
PDFC PDCR
1 1
Note 1: Read-modify-write instruction is prohibited for the registers PDFC and PDCR. Note 2: Can not read the output latch data when PD0 and PD1 are output mode.
Figure 3.5.24 Register for Port D
92CM22-72
2007-02-16
TMP92CM22 3.5.11 Port F (PF0 to PF7)
Port F is 8-bit general-purpose I/O port. Each bit can be set individually for input or output. Resetting resets the PFCR and PFFC to "0", and sets all bits to input port. And all bits of output latch register to "1". In addition to functioning as a general-purpose I/O port, port F can also function as I/O function of serial channel 0 and 1. These settings operate by writing "1" to the corresponding bit of PFFC. Resetting resets the PDCR and PDFC to "0", and sets all bits to input port. (1) Port PF0 and PF3 (TXD0/TXD1) In addition to function as I/O port, port PF0 and PF3 can also function as TXD output pin of serial channel. Thus, output buffer feature a programmable open-drain function, and setting enable by PFFC and PFCR register.
Reset
Direction control (on bit basis)
PFCR write Internal data bus
Function control (on bit basis)
PFFC write S Output latch TXD0, TXD1 PF write S B Selector A
S A Selector B
PF0 (TXD0) PF3 (TXD1) Open-drain enable
PF read
Figure 3.5.25 Port F (PF0 and PF3)
92CM22-73
2007-02-16
TMP92CM22
(2) Ports PF1 and PF4 (RXD0 and XD1) In addition to function as I/O port, port PF1 and PF4 can also function as RXD input pin of serial channel.
Reset
Direction control (on bit basis)
PFCR write Internal data bus
S Output latch PF1 (RXD0) PF4 (RXD1) S B Selector A
PF write
PF read RXD0, RXD1
Figure 3.5.26 Port F (PF and PF4)
92CM22-74
2007-02-16
TMP92CM22
(3) Port PF2 ( CTS0 , SCLK0) and port PF5 ( CTS1 , SCLK1) In addition to function as I/O port, port PF2 and PF5 can also function as CTS input pin of serial channel or SCLK I/O pin.
Reset
Direction control (on bit basis)
PFCR write Internal data bus
Function control (on bit basis)
PFFC write S Output latch SCLK0, SCLK1 output PF write
S A Selector B S B Selector A
PF2 (SCLK0, CTS0 ) PF5 (SCLK1, CTS1 )
PF read
CTS0 , CTS1 SCLK0, SCLK1 input
Figure 3.5.27 Port F (PF2 and PF5) (4) Port PF6 and port PF7 These ports are general-purpose I/O port.
Reset
R Direction control (on bit basis)
Internal data bus
PFCR write
S Output latch PF6 to PF7
PF write
S B Selector A
PF read
Figure 3.5.28 Port F (PF6 and PF7)
92CM22-75
2007-02-16
TMP92CM22
Port F Register 7
PF (003CH) Bit symbol Read/Write After reset PF7
6
PF6
5
PF5
4
PF4 R/W
3
PF
2
PF2
1
PF1
0
PF0
Data from external port (Output latch register is set to 1)
Port F Control Register 7
PFCR (003EH) Bit symbol Read/Write After reset Function 0 0 0 0 0: Input PF7C
6
PF6C
5
PF5C
4
PF4C W
3
PF3C 0 1: Output
2
PF2C 0
1
PF1C 0
0
PF0C 0
Port F Function Register 7
PFFC (003FH) Bit symbol Read/Write After reset Function 0 Always write "0". -
6
- W 0 Always write "0".
5
PF5F 0 0: Port 1: SCLK1 output
4
3
PF3F W 0 0: Port 1: TXD1
2
PF2F 0 0: Port 1: SCLK0 output
1
0
PF0F W 0 0: Port 1: TXD0
Port function setting

0
Input port TXD1 (Open drain)
1
Output port TXD1
0 1

0
Input port TXD0 (Open drain)
1
Output port TXD0
0 1
Note 1: Read-modify-write instruction is prohibited for the registers PFCR and PFFC. Note 2: PF1/RXD0 and PF4/RXD1 pins do not have a register changing PORT/FUNCTION. For example, when it is used as an input port, the input signal is inputted to SIO as the serial receive data. Note 3: PF0 and PF3 pins do not have a register (PFODE) for open-drain setting. Please conduct the open-drain setting according to above setting.
Figure 3.5.29 Register for Port F
92CM22-76
2007-02-16
TMP92CM22 3.5.12 Port G (PG0 to PG7)
Port G is 8-bit input port and can also be used as the analog input pins for the internal AD converter. PG3 can also be used as ADTRG pin for the AD converter.
Internal data bus
PG read Convertion result register AD converter Channel selector
Port G PG0 to PG7 (AN0 to AN7)
AD read
ADTRG (only PG3)
Figure 3.5.30 Port G
Port G Register 7
PG (0040H) Bit symbol Read/Write After reset PG7
6
PG6
5
PG5
4
PG4 R
3
PG3
2
PG2
1
PG1
0
PG0
Data from external port
Note: The input channel selection of AD converter and the permission of ADTRG input are set by AD converter mode register ADMOD1.
Figure 3.5.31 Register for Port G
92CM22-77
2007-02-16
TMP92CM22
3.6
Memory Controller
Function
TMP92CM22 has a memory controller with a variable 4-block address area that controls as follows. (1) 4-block address area support Specifies a start address and a block size for 4-block address area. (2) Connecting memory specifications Specifies SRAM and ROM as memories to connect with the selected address areas. (3) Data bus size selection Whether 8-bit or 16-bit is selected as the data bus size of the respective block address areas. (4) Wait control Wait specification bit in the control register and WAIT input pin control the number of waits in the external bus cycle. Read cycle and write cycle can specify the number of waits individually. The number of waits is controlled in 6 mode mentioned below.
0 waits, 1 wait, 2 waits, 3 waits, 4 waits N waits (Control with WAIT pin)
3.6.1
92CM22-78
2007-02-16
TMP92CM22 3.6.2 Control Register and Operation after Reset Release
This section describes the registers to control the memory controller, the state after reset release and necessary settings. (1) Control register The control registers of the memory controller are as follows. * Control register: BnCSH/BnCSL (n = 0 to 3, EX) Sets the basic functions of the memory controller, that is the connecting memory type, the number of waits to be read and written. Memory start address register: MSARn (n = 0 to 3) Sets a start address in the selected block address areas. Memory address mask register: MAMRn (n = 0 to 3) Sets a block size in the selected address areas.
* *
In addition to setting of the above-mentioned registers, it is necessary to set the following registers to control ROM page mode access. * Page ROM control register: PMEMCR Sets to executed ROM page mode accessing.
(2) Operation after reset release The start data bus width is determined depending on state of AM1 and AM0 pins just after reset release. Then, the external memory is accessed as follows. AM1
0 0 1 1
AM0
0 1 0 1
Start Mode
Don't use this setting Start with 16-bit data bus Start with 8-bit data bus Don't use this setting
AM1/AM0 pins are valid only just after reset release. In the other cases, the data bus width is set to the value set to BnBUS bit of the control register. By reset, only control register (B2CSH/B2CSL) of the block address area 2 is automatically effective (B2CSH is set to "1" by reset). The data bus width which is specified by AM1/AM0 pin is loaded to the bit to specify the bus width of the control register in the block address area 2. The block address area 2 is set to address 000000H to FFFFFFH by reset. After reset release, the block address areas are specified by the memory start address register (MSAR) and the memory address mask register (MAMR). Then the control register (BnCS) is set. Set the enable bit (BnE) of the control register to "1" to enable the setting.
92CM22-79
2007-02-16
TMP92CM22 3.6.3 Basic Functions and Register Setting
In this section, setting of the block address area, the connecting memory and the number of waits out of the memory controller's functions are described. (1) Block address area specification The block address area is specified by two registers. The memory start address register (MSAR) sets the start address of the block address areas. The memory controller compares between the register value and the address every bus cycles. The address bit which is masked by the memory address mask register (MAMR) is not compared by the memory controller. The block address area size is determined by setting the memory address mask register. The set value in the register is compared with the block address area on the bus. If the compared result is a match, the memory controller sets the chip select signal ( CS ) to "low". (i) Setting memory start address register The MS23 to MS16 bits of the memory start address register respectively correspond with addresses A23 to A16. The lower start address A15 to A0 are always set to address 0000H. Therefore the start address of the block address area are set to addresses 000000H to FF0000H every 64 Kbytes. (ii) Setting memory address mask registers The memory address mask register sets whether an address bit is compared or not. Set the register to "0" to compare, or to "1" not to compare. The address bit to be set is depended on the block address area. Block address area 0: A20 to A8 Block address area 1: A21 to A8 Block address area 2 to 3: A22 to A15 The above-mentioned bits are always compared. The block address area size is determined by the compared result. The size to be set depending on the block address area is as follows.
Size (bytes) CS area
256
512
32 K
64 K
128 K 256 K
512 K
1M
2M
4M
8M
CS0 CS1 CS2 to CS3

Note:
After reset release, only the control register of the block address area 2 is valid. The control register of the block address area 2 has bit. Setting bit to "0" sets the block address area 2 to addresses 000000H to FFFFFFH. State of after reset release is set this. Setting bit to "1" specifies the start address and the address area size as it is in the other block address area.
92CM22-80
2007-02-16
TMP92CM22
(iii) Example of register setting To set the block address area 1 to 512 bytes from address 110000H, set the register as follows. MSAR1 Register 7
Bit symbol Setting value M1S23 0
6
M1S22 0
5
M1S21 0
4
M1S20 1
3
M1S19 0
2
M1S18 0
1
M1S17 0
0
M1S16 1
M1S23 to M1S16 bits of the memory start address register MSAR1 correspond with address A23 to A16. A15 to A0 are cleared to "0". Therefore setting MSAR1 to the above-mentioned value specifies the start address of the block address area to address 110000H. The start address is set as it is in the other block address areas. MAMR1 Register 7
Bit symbol Setting value M1V21 0
6
M1V20 0
5
M1V19 0
4
M1V18 0
3
M1V17 0
2
M1V16 0
1
M1V15-9 0
0
M1V8 1
M1V21 to M1V16 and M1V8 bits of the memory address mask register MAMR1 set whether address A21 to A16 and A8 are compared or not. Set the register to "0" to compare, or to "1" not to compare. A23 and A22 are always compared. Setting the above-mentioned compares A23 to A9 with the values set as the start addresses. Therefore 512 bytes of addresses 110000H to 1101FFH are set as the block address area 1, and compared with the addresses on the bus. If the compared result is a match, the chip select signal CS1 is set to "low". The other block address area sizes are specified like this. Similarly, A23 is always compared in block address areas 2 to 3. Whether A22 to A15 are compared or not is set to register.
Note:
When the set block address area overlaps with the built-in memory area, or both two address areas overlap, the block address area is processed according to priority as follows.
Built-in I/O > Built-in memory > Block address area 0 >1 > 2 > 3 > CSEX
Also that any accessed areas outside the address spaces set by CS0 to CS3 are processed as the CSEX space. Therefore, settings of CSEX apply for the control of wait cycles, data bus width, etc.
92CM22-81
2007-02-16
TMP92CM22
(2) Connection memory specification Setting the BnOM1 to BnOM0 bit of the control register (BnCSH) specifies the memory type to be connected with the block address areas. The interface signal is output according to the set memory as follows. TMP92CM22 prohibit changing default (SRAM/ROM). BnOM1, BnOM0 Bit (BnCSH register) BnOM1
0 0 1 1
BnOM0
0 1 0 1
Function
SRAM/ROM (Default) (Reserved) (Reserved) (Reserved)
(3) Data bus width specification The data bus width is set for every block address area. The bus size is set by the BnBUS1 and BnBUS0 bits of the control register (BnCSH) as follows. BnBUS Bit (BnCSH register) BnBUS1
0 0 1 1
BnBUS0
0 1 0 1
Function
8-bit bus mode (Default) 16-bit bus mode (Reserved) (Reserved)
This way of changing the data bus size depending on the address being accessed is called "dynamic bus sizing". The part where the data is output to is depended on the data size, the bus width and the start address.
Note:
Since there is a possibility of abnormal writing/reading of the data if two memories with different bus width are put in consecutive addresses, do not execute an access to placed on both memories with one command.
92CM22-82
2007-02-16
TMP92CM22
Data Size (Bit)
8
Start Address
4n + 0 4n + 1 4n + 2 4n + 3
Data Width in Memory Side (Bit)
8/16 8 16 8/16 8 16 8 16
CPU Address
4n + 0 4n + 1 4n + 1 4n + 2 4n + 3 4n +3 (1) 4n + 0 (2) 4n + 1 4n + 0 (1) 4n + 1 (2) 4n + 2 (1) 4n + 1 (2) 4n + 2 (1) 4n + 2 (2) 4n + 1 4n + 2 (1) 4n + 3 (2) 4n + 4 (1) 4n + 3 (2) 4n + 4 (1) 4n + 0 (2) 4n + 1 (3) 4n + 2 (4) 4n + 3
CPU Data
D15 to D8 xxxxx xxxxx b7 to b0 xxxxx xxxxx b7 to b0 xxxxx xxxxx b15 to b8 xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx b15 to b8 xxxxx xxxxx b7 to b0 xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 b31 to b24 xxxxx xxxxx xxxxx xxxxx b7 to b0 b23 to b16 xxxxx xxxxx xxxxx xxxxx xxxxx b15 to b8 b31 to b24 xxxxx xxxxx xxxxx xxxxx b7 to b0 b23 to b16 xxxxx D7 to D0 b7 to b0 b7 to b0 xxxxx b7 to b0 b7 to b0 xxxxx b7 to b0 b15 to b8 b7 to b0 b7 to b0 b15 to b8 xxxxx b15 to b8 b7 to b0 b15 to b8 b7 to b0 b7 to b0 b15 to b8 xxxxx b15 to b8 b7 to b0 b15 to b8 b23 to b16 b31 to b24 b7 to b0 b23 to b16 b7 to b0 b15 to b8 b23 to b16 b31 to b24 xxxxx b15 to b8 b31 to b24 b7 to b0 B15 to b8 b23 to b16 b31 to b24 b7 to b0 b23 to b16 b7 to b0 b15 to b8 b23 to b16 b31 to b24 xxxxx b15 to b8 b31 to b24
16
4n + 0
4n + 1
8 16
4n + 2
8 16
4n + 3
8 16
32
4n + 0
8
16 4n + 1 8
(1) 4n + 0 (2) 4n + 2 (1) 4n + 0 (2) 4n + 1 (3) 4n + 2 (4) 4n + 3
16
(1) 4n + 1 (2) 4n + 2 (3) 4n + 4
4n + 2
8
(1) 4n + 2 (2) 4n + 3 (3) 4n + 4 (4) 4n + 5
16 4n + 3 8
(1) 4n + 2 (2) 4n + 4 (1) 4n + 3 (2) 4n + 4 (3) 4n + 5 (4) 4n + 6
16
(1) 4n + 3 (2) 4n + 4 (3) 4n + 6
xxxxx: During a read, data input to the bus ignored. At write, the bus is at high impedance and the write strobe signal remains inactive.
92CM22-83
2007-02-16
TMP92CM22
(4) Wait control The external bus cycle completes a wait of two states at least (100 ns at fSYS = 20 MHz). Setting the and of BnCSL specifies the number of waits in the read cycle and the write cycle. BnWW is set with the same method as BnWR. BnWW/BnWR Bit (BnCSL Register) BnWW2 BnWR2
0 0 1 1 1 0
BnWR1 BnWW1
0 1 0 1 1 1 Others
BnWW0 BnWR0
1 0 1 0 1 1 2 states (0 waits) 3 states (1 wait) 4 states (2 waits) 5 states (3 waits) 6 states (4 waits) (Reserved)
Function
access fixed mode access fixed mode (Default) access fixed mode access fixed mode access fixed mode
WAIT pin input mode
(i) Waits number fixed mode The bus cycle is completed with the set states. The number of states is selected from 2 states (0 waits) to 6 states (4 waits). (ii) WAIT pin input mode This mode samples the WAIT input pins. It continuously samples the WAIT pin state and inserts a wait if the pin is active. The bus cycle is minimum 2 states. The bus cycle is completed when the wait signal is non-active ("High" level) at 2 states. The bus cycle extends if the wait signal is active at 2 states and more. If a lot of connected pertain ROM and etc. (Much data-output-floating-time (tDF)), each other's data-bus-output-recovery-time is trouble. However, by setting BnREC of control register (BnCSH), can to insert dummy cycle of 1-state just before first bus cycle of starting access another block address.
BnREC Bit (BnCSH register)
0 1 No dummy cycle is inserted (Default). Dummy cycle is inserted.
92CM22-84
2007-02-16
TMP92CM22
*
CLKOUT Address
CSm
When not inserting a dummy (0 waits)
CSn RD
*
When inserting a dummy cycle (0 waits)
Dummy
CLKOUT Address
CSm
CSn
RD
92CM22-85
2007-02-16
TMP92CM22
(5) Bus access timing * External read/write bus cycle (0 waits)
T1 T2
CLKOUT (20 MHz)
CS
Address
RD
Read D7 to D0
WR
input
Write output
D7 to D0
*
External read/write bus cycle (1 wait)
T1 TW T2
CLKOUT (20 MHz)
CS
Address
RD
Read D7 to D0
WR
Input
Write Output
D7 to D0
92CM22-86
2007-02-16
TMP92CM22
* External read/write bus cycle (0 waits at WAIT pin input mode)
T1 T2
CLKOUT (20 MHz)
CS
Address
RD
Read D7 to D0
WR
Input
Write Output
D7 to D0
WAIT
Sampling
*
External read/write bus cycle (n waits at WAIT pin input mode)
CLKOUT (20 MHz)
CS
T1
TW
T2
Address
RD
Read D7 to D0
WR
Input
Write Output
D7 to D0
WAIT
Sampling
Sampling
92CM22-87
2007-02-16
TMP92CM22
Example of WAIT input cycle (5 waits)
FF0 D CK
RES
Q
FF1 D CK
RES
Q
FF2 D CK
RES
Q
FF3 D CK
RES
Q
FF4 D CK
RES
Q
WAIT
CLKOUT
CSn
RD WRLL WRLU
CLKOUT (20 MHz)
CSn
1
2
3
4
5
6
7
RD
FF_RES FF0_D FF0_Q FF1_Q FF2_Q FF3_Q
WAIT
92CM22-88
2007-02-16
TMP92CM22
(6) Connecting external memory Figure 3.6.1 shows an example of how to connect external memory to the TMP92CM22. This example connects ROM and SRAM in 16-bit width.
TMP92CM22
RD
16-bit SRAM
OE
LB
WRLL WRLU
UB
R/ W
CS0
R/W
CE
D [15:0] A0 A1 A2 A3

I/O [16:1]
Not connetion
A0 A1 A2
16-bit ROM
OE CS2 CE
DQ [15:0] A0 A1 A2
Figure 3.6.1 Example of External Memory By resetting, TMP92CM22 function as output port. Output latch of P82 ( CS2 ) is cleared to "0", and output "L". Output latch of P80 ( CS0 ), P81 ( CS1 ) and P83 ( CS3 ) are set to "1", and output "H". When set port 8 from port function to CS function, set need bit of P8FC register to "1".
Note:
When set P82 as CS2 after release reset, set function register remain output latch of P82 is "0" (P8 = 0). (P8FC = 1) If set function register (P8FC = 1) after set output latch of P82 to "1" (P8 = 1), maybe don't read ROM data during changing from port function to CS2 .
92CM22-89
2007-02-16
TMP92CM22 3.6.4 ROM Control (Page mode)
This section describes ROM page mode accessing and how to set registers. ROM page mode is set by the page ROM control register. (1) Operation and how to set the registers The TMP92CM22 supports ROM access of the page mode. ROM access of the page mode is specified only in block address area 2. ROM page mode is set by the page ROM control register (PMEMCR). Setting of the PMEMCR register to "1" sets the memory access of the block address area to ROM page mode access. The number of read cycles is set by the bit of the PMEMCR register.
OPWR1/OPWR0 Bit (PMEMCR register)
OPWR1 0 0 1 1 OPWR0 0 1 0 1 Number of Cycle in A Page 1 state (n-1-1-1 mode) (n 2) 2 states (n-2-2-2 mode) (n 3) 3states (n-3-3-3 mode) (n 4) (Reserved)
Note: Set the number of waits ("n") using the control register (BnCSL) in each block address area. The page size (The number of bytes) of ROM in the CPU side is set by the of the PMEMCR register. When data is read out up to the border of the set page, the controller completes the page reading operation. The start data of the next page is read in the normal cycle. The following data is set to page read again. PR1/PR0 Bit (PMEMCR register)
PR1 0 0 1 1 PR0 0 1 0 1 ROM Page Size 64 bytes 32 bytes 16 bytes 8 bytes
(2) Signal pulse
CLKOUT tCYC A0 to A23
CS2
+0
+1
+2
+3
tAD3
RD
tAD2
tAD2
tAD2
tHA
tAD3 D0 to D31
Data input
tHA
Data input
tHA
Data input
tHA
Data input
tHR
Figure 3.6.2 Page mode access Timing (8-byte example)
92CM22-90
2007-02-16
TMP92CM22 3.6.5 List of Registers
The memory control registers and the settings are described as follows. For the addresses of the registers, see list of special function registers in section 5. (1) Control registers The control register is a pair of BnCSL and BnCSH. ("n" is a number of the block address area.) BnCSL has the same configuration regardless of the block address areas. In BnCSH, only B2CSH which is corresponded to the block address area 2 has a different configuration from the others. BnCSL 7
Bit symbol Read/Write After reset BnWW[2:0] 0
6
BnWW2
5
BnWW1 W 1
4
BnWW0 0
3
2
BnWR2 0
1
BnWR1 W 1
0
BnWR0 0
Specifies the number of write waits. 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode
001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) BnWR[2:0] Specifies the number of read waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved)
010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode
B2CSH 7
Bit symbol Read/Write After reset B2E 1 B2E W 0 0 0
6
B2M
5
4
B2REC
3
B2OM1
2
B2OM0 W 0
1
B2BUS1 0
0
B2BUS0 0
Enable bit.
0 = No chip select signal output 1 = Chip select signal output (Default) Note: B2M After reset release, only the enable bit B2E of B2CSH register is valid ("1"). Specifies the block address area.
0 = Sets the block address area of CS2 to addresses 000000H to FFFFFFH (Default) 1 = Sets the block address area of CS2 to programmable Note: After reset release, the block address area 2 is set to addresses 000000H to FFFFFFH.
92CM22-91
2007-02-16
TMP92CM22
B2REC Sets the dummy cycle for data output recovery time. 0 = Not insert a dummy cycle (Default) 1 = Insert a dummy cycle B2OM[1:0] 00 = SRAM or ROM (Default) Others = (Reserved) B2BUS[1:0] Sets the data bus width. 00 = 8 bits (Default) 01 = 16 bits 10 = (Reserved) 11 = (Reserved) Note: The value of B2BUS bit is set according to the state of AM[1:0] pin after reset release.
BnCSH (n = 0, 1, 3) 7
Bit symbol Read/Write After reset BnE Enable bit. 0 = No chip select signal output (Default) 1 = Chip select signal output Note: After reset release, only the enable bit B2E of B2CSH register is valid ("1"). BnREC Sets the dummy cycle for data output recovery time. 0 = Not insert a dummy cycle (Default) 1 = Insert a dummy cycle BnOM[1:0] 00 = SRAM or ROM (Default) 01 = (Reserved) 10 = (Reserved) 11 = (Reserved) BnBUS[1:0] Sets the data bus width. 00 = 8 bits (Default) 01 = 16 bits 10 = (Reserved) 11 = (Reserved) BnE W 0 0 0
6
5
4
BnREC
3
BnOM1
2
BnOM0 W 0
1
BnBUS1 0
0
BnBUS0 0
92CM22-92
2007-02-16
TMP92CM22
BEXCSL 7
Bit symbol Read/Write After reset 0
6
BEXWW2
5
BEXWW1 W 1
4
BEXWW0 0
3
2
BEXWR2 0
1
BEXWR1 W 1
0
BEXWR0 0
BEXWW[2:0] Specifies the number of write waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) BEXWR[2:0] Specifies the number of read waits. 001 = 2 states (0 waits) access 101 = 4 states (2 waits) access 111 = 6 states (4 waits) access Others = (Reserved) 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 = WAIT pin input mode 010 = 3 states (1 wait) access 110 = 5 states (3 waits) access 011 =
WAIT pin input mode
BEXCSH 7
Bit Symbol Read/Write After reset BEXOM[1:0] 00 = SRAM or ROM (Default) 01 = (Reserved) 10 = (Reserved) 11 = (Reserved) BEXBUS[1:0] 00 = 8 bits (Default) 01 = 16 bits 10 = (Reserved) 11 = (Reserved)
6
-
5
- W Always write 0.
4
-
3
BEXOM1 0
2
BEXOM0 W 0
1
BEXBUS1 0
0
BEXBUS0 0
92CM22-93
2007-02-16
TMP92CM22
(1) Block address area specification register A start address and range in the block address are specified by the memory start address register (MSARn) and the memory address mask register (MAMRn). The memory start address register sets all start address similarly regardless of the block address areas. The bit to be set by the memory address mask register is depended on the block address area. MSARn (n = 0 to 3) 7
Bit symbol Read/Write After reset MnS<23:16> Sets a start address. Sets the start address of the block address areas. The bit is corresponding to the address A23 to A16. 1 1 1 1 MnS23
6
MnS22
5
MnS21
4
MnS20 R/W
3
MnS19 1
2
MnS18 1
1
MnS17 1
0
MnS16 1
MAMR0 7
Bit symbol Read/Write After reset M0V<20:8> Enables or masks comparison of the addresses. M0V20 to M0V8 are corresponding to addresses A20 to A8. The bit of M0V14 to M0V9 is corresponding to address A14 to A9 by 1 bit. If "0" is set, the comparison between the value of the address bus and the start address is enabled. If "1" is set, the comparison is masked. 1 1 1 1 M0V20
6
M0V19
5
M0V18
4
M0V17 R/W
3
M0V16 1
2
M0V15 1
1
M0V14-9 1
0
M0V8 1
MAMR1 7
Bit symbol Read/Write After reset M1V<21:8> Enables or masks comparison of the addresses. M1V21 to M1V8 are corresponding to addresses A21 to A8. The bits of M1V15 to M1V9 are corresponding to address A15 to A9 by 1 bit. If "0" is set, the comparison between the value of the address bus and the start address is enabled. If "1" is set, the comparison is masked. 1 1 1 1 M1V21
6
M1V20
5
M1V19
4
M1V18 R/W
3
M1V17 1
2
M1V16 1
1
M1V15-9 1
0
M1V8 1
MAMRn (n = 2 to 3) 7
Bit symbol Read/Write After reset MnV<22:15> Enables or masks comparison of the addresses. MnV22 to MnV15 are corresponding to addresses A22 to A15. If "0" is set, the comparison between the value of the address bus and the start address is enabled. If "1" is set, the comparison is masked. After a reset, MASR0 to MASR3 and MAMR0 to MAMR3 are set to "FFH". B0CSH, B1CSH, and B3CSH are reset to "0". This disables the CS0, CS1, and CS3 areas. However, B2CSH is reset to "0" and B2CSH to "1", and CS2 is enabled 000000H to FFFFFFH. Also the bus width and the number of waits specified in BEXCSH/L are used for accessing address except the specified CS0 to CS3 area. 1 1 1 1 MnV22
6
MnV21
5
MnV20
4
MnV19 R/W
3
MnV18 1
2
MnV17 1
1
MnV16 1
0
MnV15 1
92CM22-94
2007-02-16
TMP92CM22
(2) Page ROM control register (PMEMCR) The page ROM control register sets page ROM accessing. ROM page accessing is executed only in block address area 2. PMEMCR 7
Bit symbol Read/Write After reset OPGE Enable bit. 0 = No ROM page mode accessing (Default) 1 = ROM page mode accessing OPWR [1:0] Specifies the number of waits. 00 = 1 state (n-1-1-1 mode) (n 2) (Default) 01 = 2 states (n-2-2-2 mode) (n 3) 10 = 3 states (n-3-3-3 mode) (n 4) 11 = (Reserved) Note: Set the number of waits "n" to the control register (BnCSL) in each block address area. PR [1:0] ROM page size. 00 = 64 bytes 01 = 32 bytes 10 = 16 bytes (Default) 11 = 8 bytes 0 0
6
5
4
OPGE
3
OPWR1
2
OPWR0 R/W 0
1
PR1 1
0
PR0 0
92CM22-95
2007-02-16
TMP92CM22
Table 3.6.1 Control Register 7
Bit symbol Read/Write After reset B0CSH Bit symbol (0141H) Read/Write After reset MAMR0 Bit symbol (0142H) Read/Write After reset MSAR0 Bit symbol (0143H) Read/Write After reset B1CSL Bit symbol (0144H) Read/Write After reset B1CSH Bit symbol (0145H) Read/Write After reset MAMR1 Bit symbol (0146H) Read/Write After reset MSAR1 Bit symbol (0147H) Read/Write After reset B2CSL Bit symbol (0148H) Read/Write After reset B2CSH Bit symbol (0149H) Read/Write After reset MAMR2 Bit symbol (014AH) Read/Write After reset MSAR2 Bit symbol (014BH) Read/Write After reset B3CSL Bit symbol (014CH) Read/Write After reset B3CSH Bit symbol (014DH) Read/Write After reset MAMR3 Bit symbol (014EH) Read/Write After reset MSAR3 Bit symbol (014FH) Read/Write After reset BEXCSH Bit symbol (0159H) Read/Write After reset BEXCSL Bit symbol (0158H) Read/Write After reset PMEMCR Bit symbol (0166H) Read/Write After reset B0CSL (0140H)
6
B0WW2 0 - 0 (Note) M0V19 1 M0S22 1 B1WW2 0 - 0 (Note) M1V20 1 M1S22 1 B2WW2 0
5
B0WW1 W 1 - 0 (Note) M0V18 1 M0S21 1 B1WW1 W 1 - 0 (Note) M1V19 1 M1S21 1 B2WW1 W 1 - 0 (Note) M2V20 1 M2S21 1 B3WW1 W 1 - 0 (Note) M3V20 1 M3S21 1
4
B0WW0 0 B0REC W 0 M0V17 R/W 1 M0S20 R/W 1 B1WW0 0 B1REC W 0 M1V18 R/W 1 M1S20 R/W 1 B2WW0 0 B2REC W 0 M2V19 R/W 1 M2S20 R/W 1 B3WW0 0 B3REC W 0 M3V19 R/W 1 M3S20 R/W 1
3
2
B0WR2 0 B0OM0 0 M0V15 1 M0S18 1 B1WR2 0 B1OM0 0 M1V16 1 M1S18 1 B2WR2 0
1
B0WR1 W 1 B0BUS1 0 M0V14-V9 1 M0S17 1 B1WR1 W 1 B1BUS1 0 M1V15-V9 1 M1S17 1 B2WR1 W 1 B2BUS1 0 M2V16 1 M2S17 1 B3WR1 W 1 B3BUS1 0 M3V16 1 M3S17 1 BEXBUS1 W 0 BEXWR1 W 1 PR1 1
0
B0WR0 0 B0BUS0 0 M0V8 1 M0S16 1 B1WR0 0 B1BUS0 0 M1V8 1 M1S16 1 B2WR0 0 B2BUS0 0 M2V15 1 M2S16 1 B3WR0 0 B3BUS0 0 M3V15 1 M3S16 1 BEXBUS0 0 BEXWR0 0 PR0 0
B0E 0 M0V20 1 M0S23 1
B0OM1 0 M0V16 1 M0S19 1
B1E 0 M1V21 1 M1S23 1
B1OM1 0 M1V17 1 M1S19 1
B2E 1 M2V22 1 M2S23 1
B2M 0 M2V21 1 M2S22 1 B3WW2 0 - 0 (Note) M3V21 1 M3S22 1
B2OM1 0 M2V18 1 M2S19 1
B2OM0 0 M2V17 1 M2S18 1 B3WR2 0 B3OM0 0 M3V17 1 M3S18 1 BEXOM0 0 BEXWR2 0 OPWR0 R/W 0
B3E 0 M3V22 1 M3S23 1
B3OM1 0 M3V18 1 M3S19 1 BEXOM1 0
BEXWW2 0
BEXWW1 W 1
BEXWW0 0 OPGE 0
OPWR1 0
Note1: Always write "0". Note2: Read-modify-write instruction is prohibited for BnCSL, BnCSH registers (n=0 to 3, EX).
92CM22-96
2007-02-16
TMP92CM22 3.6.6 Caution
If the parasitic capacitance of the read signal (Output enable signal) is greater than that of the chip select signal, it is possible that an unintended read cycle occurs due to a delay in the read signal. Such an unintended read cycle may cause a trouble as in the case of (a) in Figure 3.6.3
CLKOUT (20 MHz) Address Memory 1 chip select Memory 2 chip select
RD
(a)
Figure 3.6.3 Read Signal Delay Read Cycle Example: When using an externally connected flash EEPROM which users JEDEC standard commands, note that the toggle bit may not be read out correctly. If the read signal in the cycle immediately preceding the access to the flash EEPROM does not go "high" in time, as shown in Figure 3.6.4 an unintended read cycle like the one shown in (b) may occur.
Memory access CLKOUT (20 MHz) Address Flash EEPROM chip select Read Toggle bit (b) Toggle bit RD cycle 1
Figure 3.6.4 Flash EEPROM Toggle Bit Read Cycle When the toggle bit reverse with this unexpected read cycle, TMP92CM22 always reads same value of the toggle bit, and cannot read the toggle bit correctly. To avoid this phenomenon, the data polling control recommended.
92CM22-97
2007-02-16
TMP92CM22
(2) The cautions at the time of the functional change of a
CSn .
A chip select signal output has the case of a combination terminal with a general-purpose port function. In this case, an output latch register and a function control register are initialized by the reset action, and an object terminal is initialized by the port output ("1" or "0") by it. Functional change Although an object terminal is changed from a port to a chip select signal output by setting up a function control register (PnFC register), the short pulse for several ns may be outputted to the changing timing. Although it does not become especially a problem when using the usual memory, it may become a problem when using a special memory.
* XX is a function register address.(When an output port is initialized by "0") A port is set as CSn . Internal Signal Internal address bus Function control signal Output port External Signal Pxx A23 to A0 n n+2 Output pulse tAD3
CSn
n
XX
n+2
The measure by software The countermeasures in S/W for avoiding this phenomenon are explained. Since CS signal decodes the address of the access area and is generated, an unnecessary pulse is outputted by access to the object CS area immediately after setting it as a CSn function. Then, if internal area is accessed also immediately after setting a port as CS function, an unnecessary pulse will not output. 1. Prohibition of use of an NMI function 2. The ban on interruption under functional change (DI command) 3. A dummy command is added in order to carry out continuous internal access. 4. (Access to a functional change register is corresponded by 16-bit command. (LDW command))
A port is set as CSn . Internal Internal address bus Function control signal Output port External signal Pxx A23 to A0 n n+2
CSn
Dummy access n+2
signal
XX
XX+1
92CM22-98
2007-02-16
TMP92CM22
3.7
8-Bit Timers (TMRA)
The TMP92CM22 features 4 built-in 8-bit timers. These timers are paired into four modules: TMRA01 and TMRA23. Each module consists of two channels and can operate in any of the following four operating modes. * 8-bit interval timer mode * * * 16-bit interval timer mode 8-bit programmable square wave pulse generation output mode (PPG: Variable duty cycle with variable period) 8-bit pulse width modulation output mode (PWM: Variable duty cycle with constant period)
Figure 3.7.1 and Figure 3.7.2 show block diagrams for TMRA01 and TMRA23. Each channel consists of an 8-bit up counter, an 8-bit comparator and an 8-bit timer register. In addition, a timer flip-flop and a prescaler are provided for each pair of channels. The operation mode and timer flip-flops are controlled by five controls SFR (Special-function registers). Each of the two modules (TMRA01 and TMRA23) can be operated independently. All modules operate in the same manner; hence only the operation of TMRA01 is explained here. The contents of this chapter are as follows. 3.7.1 Block diagrams 3.7.2 Operation of Each Circuit 3.7.3 SFRs 3.7.4 Operation in Each Mode (1) 8-bit timer mode (2) 16-bit timer mode (3) 8-bit PPG (Programmable pulse generation) output mode (4) 8-bit PWM (Pulse width modulation) output mode (5) Mode settings Table 3.7.1 Registers and Pins for Each Module Module Specification
Input pin for external clock External pin Output pin for timer flip-flop Timer RUN register Timer register SFR (Address) Timer mode register Timer flip-flop control register
Timer A01
TA0IN (Shared with PC0) TA1OUT (Shared with PC1) TA01RUN (1100H) TA0REG (1102H) TA1REG (1103H) TA01MOD (1104H) TA1FFCR (1105H)
Timer A23
None TA3OUT (Shared with PC5) TA23RUN (1108H) TA2REG (110AH) TA3REG (110BH) TA23MOD (110CH) TA3FFCR (110DH)
92CM22-99
2007-02-16
3.7.1
Prescaler 16 32 64 128 256 512 T16 Timer flip-flop TA1FF TA01RUN Selector TA1FFCR 8-bit up counter (UC1) 8-bit up counter (UC0) 2
overflow
n
Prescaler clock: T0 TA01RUN T256
2
4
8
Run/clear
T1
T4
Block Diagrams
Timer flip-flop output: TA1OUT
TA01RUN
Selector T1 T16 T256 TA01MOD
External input clock: TA0IN
T1 T4 T16
Figure 3.7.1 TMRA01 Block Diagram
TA01MOD
92CM22-100
8-bit comparator (CP0) TA01MOD 8-bit timer register TA0REG Match detect TA0TRG 8-bit comparator (CP1) Register buffer 0 Internal data bus TMRA0 interrupt output: INTTA0
TA01MOD
Match detect
8-bit timer register TA1REG
TA01RUN
TMP92CM22
2007-02-16
Internal data bus TMRA0 match output: TA0TRG
TMRA1 interrupt output: INTTA1
Prescaler 4 T4 T16 T256 8 16 32 64 128 256 512 Run/clear TA23RUN Timer flip-flop TA3FF TA23RUN Selector 8-bit up counter (UC2) 2 overflow TA23MOD TA23MOD
n
Prescaler clock: T0
2
T1
Timer flip-flop output: TA3OUT
TA23RUN Selector 8-bit up counter (UC3) T1 T16 T256
TA3FFCR
T1 T4 T16
Figure 3.7.2 TMRA23 Block Diagram
92CM22-101
8-bit comparator (CP2) Match detect TA2TRG TA23MOD 8-bit timer register TA2REG Register buffer 2 Internal data bus TMRA2 interrupt output: INTTA2
TA23MOD
8-bit comparator register (CP3)
Match detect
8-bit timer register TA3REG
TA23RUN
TMP92CM22
2007-02-16
Internal data bus TMRA2 match output: TA2TRG
TMRA3 interrupt outptu: INTTA3
TMP92CM22 3.7.2 Operation of Each Circuit
(1) Prescaler A 9-bit prescaler generates the input clock to TMRA01. The prescaler's operation can be controlled using TA01RUN in the timer control register. Setting to "1" starts the count; setting to "0" clears the prescaler to "0" and stops operation. Table 3.7.2 shows the various prescaler output clock resolutions.
Table 3.7.2 Prescaler Output Clock Resolution
Clock gear selection SYSCR1 000 (1/1) 001 (1/2) 010 (1/4) 011 (1/8) 100 (1/16) 0 (fc) 1/8 System clock selection SYSCR1
- T1(1/2)
fc/16 fc/32 fc/64 fc/128 fc/256
Timer counter input clock TMRA prescaler TAxMOD T4(1/8)
fc/64 fc/128 fc/256 fc/512 fc/1024
T16(1/32) T256(1/512)
fc/256 fc/512 fc/1024 fc/2048 fc/4096 fc/4096 fc/8192 fc/16384 fc/32768 fc/65536
(2) Up counters (UC0 and UC1) These are 8-bit binary counters which count up the input clock pulses for the clock specified by TA01MOD. The input clock for UC0 is selectable and can be either the external clock input via the TA0IN pin or one of the three internal clocks T1, T4, or T16. The clock setting is specified by the value set in TA01MOD. The input clock for UC1 depends on the operation mode. In 16-bit timer mode, the overflow output from UC0 is used as the input clock. In any mode other than 16-bit timer mode, the input clock is selectable and can either be one of the internal clocks T1, T16, or T256, or the comparator output (The match detection signal) from TMRA0. For each interval timer the timer operation control register bits TA01RUN and TA01RUN can be used to stop and clear the up counters and to control their count. A reset release both up counters, stopping the timers.
92CM22-102
2007-02-16
TMP92CM22
(3) Timer registers (TA0REG and TA1REG) These are 8-bit registers, which can be used to set a time interval. When the value set in the timer register TA0REG or TA1REG matches the value in the corresponding up counter, the comparator match detect signal goes Active. If the value set in the timer register is 00H, the signal goes active when the up counter overflows. The TA0REG are double buffer structure, each of which makes a pair with register buffer. The setting of the bit TA01RUN determines whether TA0REG's double buffer structure is enabled or disabled. It is disabled if = "0" and enabled if = "1". When the double buffer is enabled, data is transferred from the register buffer to the timer register when a 2n overflow occurs in PWM mode, or at the start of the PPG cycle in PPG mode. Hence the double buffer cannot be used in timer mode. A reset initializes to "0", disabling the double buffer. To use the double buffer, write data to the timer register, set to "1", and write the following data to the register buffer Figure 3.7.3 show the configuration of TA0REG
Timer register A0 (TA0REG) B Shift trigger Register buffer 0 Selector S A Write to TA0REG Match detecting PPG cycle n PWM 2 overflow
Write Internal data bus TA01RUN
Figure 3.7.3 Timer Register A0 (TA0REG) Note: The same memory address is allocated to the timer register and the register buffer. When = 0, the same value is written to the register buffer and the timer register; when = 1, only the register buffer is written to.
The address of each timer register is as follows. TA0REG: 001102H TA1REG: 001103H TA2REG: 00110AH TA3REG: 00110BH All these registers are write-only and cannot be read.
92CM22-103
2007-02-16
TMP92CM22
(4) Comparator (CP0) The comparator compares the value in an up counter with the value set in a timer register. If they match, the up counter is cleared to 0 and an interrupt signal (INTTA0 or INTTA1) is generated. If timer flip-flop inversion is enabled, the timer flip-flop is inverted at the same time. (5) Timer flip-flop (TA1FF) The timer flip-flop (TA1FF) is a flip-flop inverted by the match detects signal (8-bit comparator output) of each interval timer. Whether inversion is enabled or disabled is determined by the setting of the bit TA1FFCR in the timer flip-flops control register. A reset clears the value of TA1FF to "0". Programming "01" or "10" to TA1FFCR sets TA1FF to 0 or 1. Programming "00" to these bits inverts the value of TA1FF. (This is known as software inversion.) The TA1FF signal is output via the TA1OUT pin (which can also be used as PC1). When this pin is used as the timer output, the timer flip-flop should be set beforehand using the port C function register PCFC.
Note: When the double buffer is enabled for an 8-bit timer in PWM or PPG mode, caution is required as explained below. If new data is written to the register buffer immediately before an overflow occurs by a match between the timer register value and the up-counter value, the timer flip-flop may output an unexpected value. For this reason, make sure that in PWM mode new data is written to the register buffer by six cycles (fSYS x 6) before the next overflow occurs by using an overflow interrupt. When using PPG mode, make sure that new data is written to the register buffer by six cycles before the next cycle compare match occurs by using a cycle compare match interrupt. Example when using PWM mode
Match between TA0REG and up-counter 2 overflow interrupt (INTTA0) TA1OUT tPWM (PWM cycle)
n
Desired PWM cycle change point Write new data to the register buffer before the next overflow occurs by using an overflow interrupt
92CM22-104
2007-02-16
TMP92CM22 3.7.3 SFRs
TMRA01 Run Register 7
TA01RUN Bit symbol (1100H) Read/Write After reset Function TA0RDE R/W 0 Double buffer 0: Disable 1: Enable 0 IDLE2 0: Stop 1: Operate 0 TMRA01 prescaler
6
5
4
3
I2TA01
2
TA01PRUN R/W
1
TA1RUN 0 UP counter (UC1)
0
TA0RUN 0 UP counter (UC0)
0: Stop and clear 1: Run (Count up)
TA0REG double buffer control 0 1 Disable Enable
Count operation 0 1 Stop and clear Count
Note: The values of bits 4 to 6 of TA01RUN are undefined when read.
TMRA23 Run Register 7
TA23RUN Bit symbol (1108H) Read/Write After reset Function TA2RDE R/W 0 Double buffer 0: Disable 1: Enable 0 IDLE2 0: Stop 1: Operate 0 TMRA23 prescaler
6
5
4
3
I2TA23
2
TA23PRUN R/W
1
TA3RUN 0 UP counter (UC3)
0
TA2RUN 0 UP counter (UC2)
0: Stop and clear 1: Run (Count up)
TA2REG double buffer control 0 1 Disable Enable
Count operation 0 1 Stop and clear Count
Note: The values of bits 4 to 6 of TA23RUN are undefined when read.
Figure 3.7.4 Register for TMRA
92CM22-105
2007-02-16
TMP92CM22
TMRA01 Mode Register 7
TA01MOD Bit symbol (1104H) Read/Write After reset Function TA01M1 0
6
TA01M0 0
5
PWM01 0 PWM cycle 00: Reserved 6 01: 2 7 10: 2 8 11: 2
4
PWM00 0 R/W
3
TA1CLK1 0
2
TA1CLK0 0
1
TA0CLK1 0
0
TA0CLK0 0
Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
TMRA1 source clock 00: TA0TRG 01: T1 10: T16 11: T256
TMRA0 source clock 00: TA0IN pin input (Note) 01: T1 10: T4 11: T16
TMRA0 input clock 00 01 10 11 TA0IN (External input) T1 (Prescaler) T4 (Prescaler) T16 (Prescaler)
TMRA1 input clock TA01MOD 01 00 01 10 11
Matching output for TMRA0
TA01MOD = 01
Overflow output for TMRA0
T1 T16 T256
(16-bit timer mode)
Select cycle in PWM mode 00 01 10 11 Reserved 2 x Source clock
6 7
2 x Source clock 2 x Source clock
8
Select operation mode for TMR01 00 01 10 11 8-bit timers x 2ch 16-bit timer 8-bit PPG 8-bit PWM (TMRA0), 8-bit timer (TMRA1)
Note:
When set TA0IN pin, set TA01MOD after set port C.
Figure 3.7.5 Register for TMRA01
92CM22-106
2007-02-16
TMP92CM22
TMRA23 Mode Register 7
TA23MOD (110CH) Bit symbol Read/Write After reset Function 0 0 0 PWM cycle 00: Reserved 6 01: 2 7 10: 2 8 11: 2 0 Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode TA23M1
6
TA23M0
5
PWM21
4
PWM20 R/W
3
TA3CLK1 0
2
TA3CLK0 0
1
TA2CLK1 0
0
TA2CLK0 0
TMRA3 source clock 00: TA2TRG 01: T1 10: T16 11: T256
TMRA2 source clock 00: Reserved 01: T1 10: T4 11: T16
TMRA2 input clock 00 01 10 11 Don't set T1 (Prescaler) T4 (Prescaler) T16 (Prescaler)
TMRA3 input clock TA23MOD 01 00 01 10 11 TA23MOD = 01
Matching output for TMRA2 Overflow output for TMRA2 T1 T16 T256 (16-bit timer mode)
Select cycle in PWM mode 00 01 10 11 Reserved 2 x Source clock
6 7
2 x Source clock 2 x Source clock
8
Select operation mode for TMRA23 00 01 10 11 8-bit timer x 2ch 16-bit timer 8-bit PPG 8-bit PWM (TMRA2), 8-bit timer (TMRA3)
Figure 3.7.6 Register for TMRA23
92CM22-107
2007-02-16
TMP92CM22
TMRA1 Flip Flop Control Register 7
TA1FFCR (1105H) Bit symbol Read/Write After reset Read-modify Function -write instruction is prohibited. 1 1 00: Invert TA1FF 01: Set TA1FF to "1" 10: Clear TA1FF to "0" 11: Don't care
6
5
4
3
TA1FFC1
2
TA1FFC0 R/W
1
TA1FFCIE 0 TA1FF control for inversion 0: Disable 1: Enable
0
TA1FFCIS 0 TA1FF Inversion signal select 0: TMRA0 1: TMRA1
Inversion signal for timer flip-flop 1 (TA1FF) (Don't care except in 8-bit timer mode) 0 1 Inversion by TMRA0 Inversion by TMRA1
TA1FF control for inversion 0 1 Disable inversion Enable inversion
TFF1 control 00 Note: The values of bits 4 to 7 of TA1FFCR are undefined when read. 01 10 11 Invert TA1FF Set TA1FF to "1" Clear TA1FF to "0" Don't care
Figure 3.7.7 Register for TMRA
92CM22-108
2007-02-16
TMP92CM22
TMRA3 Flip-Flop Control Register 7
TA3FFCR (110DH) Bit symbol Read/Write After reset Read-modify -write instruction is prohibited. Function 1 1 00: Invert TA3FF 01: Set TA3FF to "1" 10: Clear TA3FF to "0" 11: Don't care
6
5
4
3
TA3FFC1
2
TA3FFC0 R/W
1
TA3FFCIE 0 TA3FF control for inversion 0: Disable 1: Enable
0
TA3FFCIS 0 TA3FF inversion select 0: TMRA2 1: TMRA3
Inverse signal for timer flip-flop 3 (TA3FF) (Don't care except in 8-bit timer mode) 0 1 Invert TMRA2 Invert TMRA3
TA3FF control for inversion 0 1 Disable inversion Enable inversion
TA3FF control 00 Invert TA3FF Note: The values of bits 4 to 7 of TA3FFCR are undefined when read. 01 Set TA3FF to "1" 10 Clear TA3FF to "0" 11 Don't care
Figure 3.7.8 Register for TMRA
92CM22-109
2007-02-16
TMP92CM22
Timer Register (TA0REG to TA3REG) Symbol
TA0REG
Address
1102H
7
6
5
4
- W Undefined -
3
2
1
0
TA1REG
1103H
W Undefined -
TA2REG
110AH
W Undefined -
TA3REG
110BH
W Undefined
Note: Read-modify-write instruction is prohibited for above registers.
Figure 3.7.9 Register for TMRA
92CM22-110
2007-02-16
TMP92CM22 3.7.4
Operation in Each Mode
(1) 8-bit timer mode Both TMRA0 and TMRA1 can be used independently as 8-bit interval timers. When set function and count data, TMRA0 and TMRA1 should be stopped. 1. Generating interrupts at a fixed interval (using TMRA1) To generate interrupts at constant intervals using TMRA1 (INTTA1), first stop TMRA1 then set the operation mode, input clock and a cycle to TA01MOD and TA1REG register, respectively. Then, enable the interrupt INTTA1 and start TMRA1 counting. Example: To generate an INTTA1 interrupt every 40 s at fC = 40 MHz, set each register as follows:
MSB 7 TA01RUN TA01MOD TA1REG INTETA01 TA01RUN X : Don't care, - 0 0 X - 6 X 0 1 1 X 5 X X 1 0 X 4 X X 0 1 X 3 - 0 0 - - 2 - 1 1 - 1 LSB 1 0 - 0 - 1 0 - - 0 - - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and select T1 (=(16/fc)s at fC = 40MHz) as the input clock. Set 40 s / T1 = 100 = 64H to TAREG. Enable INTTA1 and set it to Level 5. Start TMRA1 counting.
- : No change
Select the input clock refers to Table 3.7.3. Table 3.7.3 Selecting Interrupt Interval and the Input Clock Using 8-Bit Timer Input clock
T1 (8/fSYS) T4 (32/fSYS) T16 (128/fSYS) T256 (2048/fSYS)
Interrupt Interval (at fSYS = 20 MHz)
0.4 s to 102.4 s 1.6 s to 409.6 s 6.4 s to 1.638 ms 102.4 s to 26.21 ms
Resolution
0.4 s 1.6 s 6.4 s 102.4 s
Note:
The input clocks for TMRA0 and TMRA1 differ as follows: TMRA0: Uses TMRA0 input (TA0IN) and can be selected from T1, T4, or T16. TMRA1: Matches output of TMRA0 (TA0TRG) and can be selected from T1, T16, T256.
92CM22-111
2007-02-16
TMP92CM22
2. Generating a 50% duty ratio square wave pulse The state of the timer flip-flop (TA1FF1) is inverted at constant intervals and its status output via the timer output pin (TA1OUT). Example: To output a 2.4 s square wave pulse from the TA1OUT pin at fC = 40 MHz, use the following procedure to make the appropriate register settings. This example uses TMRA1; however, either TMRA0 or TMRA1 may be used.
MSB 7 TA01RUN TA01MOD TA1REG TA1FFCR - 0 0 X 6 X 0 0 X 5 X X 0 X 4 X X 0 X 3 - 0 0 1 2 - 1 0 0
LSB 1 0 - 1 1 0 - - 1 1 Stop TMRA1 and clear it to 0. Select 8-bit timer mode and select T1 (=(16/fc)s at fC = 40MHz) as the input clock. Set the timer register to 2.4 s / T1 / 2 = 3. Clear TA1FF to 0 and set it to invert on the match detect signal from TMRA1.
PCCR PCFC TA01RUN
X X -
- - X
- - X
X X X
- - -
X X 1
1 1 1
- - -
Set PC1 to function as the TA1OUT pin. Start TMRA1 counting.
X : Don't care, - : No change
T1 TA01RUN Bit7 to 2 Up counter Bit1 Bit0 Comparator timing Comparator output (Match detect) INTTA1 Up counter clear 0 1 2 3 0 1 2 3 0 1 2 3 0
TA1FF TA1OUT 1.2 s at fC = 40 MHz
Figure 3.7.10 Square Wave Output Timing Chart (50% duty)
92CM22-112
2007-02-16
TMP92CM22
3. Making TMRA1 count up on the match signal from the TMRA0 comparator Select 8-bit timer mode and set the comparator output from TMRA0 to be the input clock to TMRA1.
Comparator (Match output forTMRA0) TMRA0 up counter (when TA0REG = 5) TMRA1 up counter (when TA1REG = 2) Match output for TMRA1 1 2 3 1 4 5 1 2 3 2 4 5 1 2 1 3
Figure 3.7.11 TMRA1 Count up on Signal from TMRA0 (2) 16-bit timer mode A 16-bit interval timer is configured by pairing the two 8-bit timers TMRA0 and TMRA1. To make a 16-bit interval timer, in which TMRA0 and TMRA1 are cascaded together, set TA01MOD to 01. In 16-bit timer mode, the overflow output from TMRA0 is used as the input clock for TMRA1, regardless of the value set in TA01MOD. Table 3.7.3 shows the relationship between the timer (Interrupt) cycle and the input clock selection. To set the timer interrupt interval, set the lower eight bits in timer register TA0REG and the upper eight bits in TA1REG. Be sure to set TA0REG first (As entering data in TA0REG temporarily disables the compare, while entering data in TA1REG starts the compare). Example: To generate an INTTA1 interrupt every 0.4 s at fC = 40 MHz, set the timer registers TA0REG and TA1REG as follows: If T16 (= (256/fc)s at fC = 40MHz) is used as the input clock for counting, set the following value in the registers: 0.4 s / (256/fc)s = 62500 = F424H; e.g., set TA1REG to F4H and TA0REG to 24H.
92CM22-113
2007-02-16
TMP92CM22
The comparator match signal is output from TMRA0 each time the up counter UC0 matches TA0REG, though the up-counter UC0 is not cleared. In the case of the TMRA1 comparator, the match detect signal is output on each comparator pulse on which the values in the up counter UC1 and TA1REG match. When the match detect signal is output simultaneously from both the comparator TMRA0 and TMRA1, the up counters UC0 and UC1 are cleared to 0 and the interrupt INTTA1 is generated. Also, if inversion is enabled, the value of the timer flip-flop TA1FF is inverted.
Example: When TA1REG = 04H and TA0REG = 80H
Value of up counter (UC1, UC0) TMRA0 comparator match detect signal TMRA1 comparator match detect signal Interrupt INTTA0 Interrupt INTTA1 Timer output TA1OUT Inversion 0080H 0180H 0280H 0380H 0480H 0080H
Figure 3.7.12 Timer Output by 16-Bit Timer Mode
(3) 8-bit PPG (Programmable pulse generation) output mode Square wave pulses can be generated at any frequency and duty ratio by TMRA0. The output pulses may be active-low or active-high. In this mode TMRA1 cannot be used. TMRA0 outputs pulses on the TA1OUT pin (Shared with PC1).
tH = "10" t tL = "01" t Example: = "01" TA0REG and UC0 match (Interrupt INTTA0) TA1REG and UC0 match (Interrupt INTTA1) TA1OUT TA0REG TA1REG tH tL
Figure 3.7.13 8-Bit PPG Output Waveforms
92CM22-114
2007-02-16
TMP92CM22
In this mode, a programmable square wave is generated by inverting the timer output each time the 8-bit up counter (UC0) matches the value in one of the timer registers TA0REG or TA1REG. The value set in TA0REG must be smaller than the value set in TA1REG. Although the up counter for TMRA1 (UC1) is not used in this mode, TA01RUN should be set to "1", so that UC1 is set for counting. Figure 3.7.14 shows a block diagram representing this mode.
TA01RUN TA0IN T1 T4 T16 Selector 8-bit up counter (UC0)
TA1OUT TA1FFCR
TA1FF
TA01MOD
Inversion INTTA0
Comparator
Comparator
INTTA1
Selector
TA0REG Shift trigger
TA0REG-WR TA01RUN Register buffer TA1REG
Internal data bus
Figure 3.7.14 Block Diagram of 8-Bit PPG Output Mode If the TA0REG double buffer is enabled in this mode, the value of the register buffer will be shifted into TA0REG each time TA1REG matches UC0. Use of the double buffer facilitates the handling of low-duty waves (when duty is varied).
Match with TA0REG and UC0 Match withTA1REG
(Up counter = Q2)
(Up counter = Q2) Shift into register buffer
TA0REG (Value of compare) Register buffer
Q1 Q2
Q2 Q3 Write TA0REG (Register buffer)
Figure 3.7.15 Operation of Register Buffer
92CM22-115
2007-02-16
TMP92CM22
Example: To generate 1/4 duty 62.5 kHz pulses (at fC= 40 MHz):
16 s
Calculate the value that should be set in the timer register. To obtain a frequency of 62.5 kHz, the pulse cycle t should be: t = 1/62.5 kHz = 16 s T1 (= (16/fc)s (at fC = 40MHz); 16 s/(16/fc)s = 40 Therefore set TA1REG to 40 (28H) The duty is to be set to 1/4: t x 1/4 = 16 s x 1/4 = 4 s 4 s/(16/fc)s = 10 Therefore, set TA0REG = 10 = 0AH
7 TA01RUN TA01MOD TA0REG TA1REG TA1FFCR PCCR PCFC TA01RUN X : Don't care, 0 1 0 0 X X X 1
6 X 0 0 0 X
5 X X 0 1 X
4 X X 0 0 X X X X
3 - X 1 1 0
2 0 X 0 0 1 X X 1
1 0 0 1 0 1 1 1 1
0 0 1 0 0 X Stop TMRA0 and TMRA1 and clear it to "0". Set the 8-bit PPG mode, and select T1 as input clock. Write 0AH. Write 28H. Set TA1FF and set inversion to enable. Writing "10" provides negative logic pulse. Set PC1 to TA1OUT pin. Start TMRA0 and TMRA1 counting.
-- --
X X
- - -
- -
1
- : No change
92CM22-116
2007-02-16
TMP92CM22
(4) 8-bit PWM (Pulse width modulation) output mode This mode is only valid for TMRA0. In this mode, a PWM pulse with the maximum resolution of 8 bits can be output. When TMRA0 is used the PWM pulse is output on the TA1OUT pin (which is also used as PC1). TMRA1 can also be used as an 8-bit timer. The timer output is inverted when the up counter (UC0) matches the value set in the timer register TA0REG or when 2n counter overflow occurs (n = 6, 7, or 8 as specified by TA01MOD). The up counter UC0 is cleared when 2n counter overflow occurs. The following conditions must be satisfied before this PWM mode can be used. Value set in TA0REG < Value of set for 2n counter overflow Value set in TA0REG 0
Match with TA0REG and UC0 2 overflow (Interrupt INTTA0)
n
TA1OUT tPWM (PWM cycle)
Figure 3.7.16 8-Bit Output Wave Form Figure 3.7.17 shows a block diagram representing this mode.
TA01RUN TA0IN T1 T4 T16 8-bit up counter (UC0) TA1OUT TA1FFCR
Selector
Clear
TA1FF
Inversion 2 overflow control
n
TA01MOD
TA01MOD
Comparator
Overflow
INTTA0 TA0REG Selector TA0REG-WR TA01RUN Register buffer Shift trigger
Internal data bus
Figure 3.7.17 Block Diagram of 8-Bit PWM Output Mode
92CM22-117
2007-02-16
TMP92CM22
In this mode, the value of the register buffer will be shifted into TA0REG if 2n overflow is detected when the TA0REG double buffer is enabled. Use of the double buffer facilitates the handling of low duty ratio waves.
Match with TA0REG Up counter = Q1 2
n
Up counter = Q2 Shift from TA0REG (Register buffer)
overflow Q1 Q2 Q2 Q3 Write to TA0REG
TA0REG (Value of compare) Register buffer
Figure 3.7.18 Operation of Register Buffer Example: To output the following PWM waves on the TA1OUT pin at fC = 40 MHz:
36.0 s 51.2 s
To achieve a 51.2 s PWM cycle by setting T1=(16/fc)s (at fC = 40 MHz): 51.2 s/(16/fc)s = 128 = 2n Therefore n should be set to 7. Since the low-level period is 36.0 s when T1 = (16/fc)s, set the following value for TA0REG: 36.0 s/(16/fc)s = 90 = 5AH
MSB 7 TA01RUN TA01MOD TA0REG TA1FFCR PCCR PCFC TA01RUN - 1 0 X X X 1 6 X 1 1 X 5 X 1 0 X 4 X 0 1 X X X X 3 2
LSB 1 0 0 1 0 X - - 1 Stop TMRA0 and clear it to 0. Select 8-bit PWM mode (cycle: 2 ) and select T1 as the input clock.
7
--- -- 0
1 1 - 0 0 X X 1 1 1 1 1 -
Write 5AH. Clear TA1FF to 0; set inversion to enable.
-- --
X X
- -
Set PC1 to TA1OUT pin. Start TMRA0 counting.
X : Don't care, - : No change
92CM22-118
2007-02-16
TMP92CM22
Table 3.7.4 Relationship of PWM Cycle and 2n Counter
Clock gear SYSCR1 System clock SYSCR0
PWM cycle TAxxMOD - T1(x2) 2 (x64) TAxxMOD T4(x8)
4096/fc 8192/fc 16384/fc 32768/fc 65536/fc
6
2 (x128) TAxxMOD T1(x2)
2048/fc 4096/fc 8192/fc 16384/fc 32768/fc
7
2 (x256) TAxxMOD T1(x2)
4096/fc 8192/fc 16384/fc 32768/fc 65536/fc
8
T16(x32)
16384/fc 32768/fc 65536/fc 131072/fc 262144/fc
T4(x8)
8192/fc 16384/fc 32768/fc 65536/fc 131072/fc
T16(x32)
32768/fc 65536/fc 131072/fc 262144/fc 524288/fc
T4(x8)
16384/fc 32768/fc 65536/fc 131072/fc 262144/fc
T16(x32)
65536/fc 131072/fc 262144/fc 524288/fc 1048576/fc
000(x1) 001(x2) 010(x4) 011(x8) 100(x16) 0(fc) x8
1024/fc 2048/fc 4096/fc 8192/fc 16384/fc
(5) Mode settings Table 3.7.5 shows the SFR settings for each mode. Table 3.7.5 Timer Mode Setting Registers
Register Name Function Timer mode PWM cycle TA01MOD Upper timer input clock Lower timer match, T1, T16, T256 (00, 01, 10, 11) Lower timer input clock External T1, T4, T16 (00, 01, 10, 11) External T1, T4, T16 (00, 01, 10, 11) External T1, T4, T16 (00, 01, 10, 11) External T1, T4, T16 (00, 01, 10, 11) - TA1FFCR Timer F/F inversion select 0: Lower timer output 1: Upper timer output 16-bit timer mode 01 - - -
8-bit timer x 2 channels
00
-
8-bit PPG x 1 channel
10
6
-
7 8
-
-
8-bit PWM x 1 channel 8-bit timer x 1 channel
11
2,2,2 (01, 10, 11) -
- T1, T16, T256 (01, 10, 11)
-
11
Output disable
- : Don't care
92CM22-119
2007-02-16
TMP92CM22
3.8
16-Bit Timer/Event Counters (TMRB)
The TMP92CM22 contains 2 channels 16-bit timer/event counter (TMRB) which have the following operation modes: * * * 16-bit interval timer mode 16-bit event counter mode 16-bit programmable square wave pulse generation output mode (PPG: Variable duty cycle with variable period)
Can be used following operation modes by capture function: * Frequency measurement mode * * Pulse width measurement mode Time differential measurement mode
Figure 3.8.1 to Figure 3.8.2 show block diagram of TMRB0 and TMRB1. Each timer/event counter consists of a 16-bit up counter, two 16-bit timer registers (One of them with a double-buffer structure), two 16-bit capture registers, two comparators, a capture input controller, a timer flip-flop and a control circuit. Each timer/event counter is controlled by 11-byte control register (SFR). This chapter consists of the following items: 3.8.1 Block diagram 3.8.2 Operation 3.8.3 SFRs 3.8.4 Operation in Each Mode (1) 16-bit interval timer mode (2) 16-bit event/counter mode (3) 16-bit programmable pulse generation (PPG) output mode (4) Capture function examples Table 3.8.1 Pins and SFR of TMRB Channel Spec
External clock/ External pin Caputre triggr input pin Timer flip-flop output pin Timre run register Timrer mode register Timre flip-flop control register TB0OUT0 (Share with PC6) TB0RUN (1180H) TB0MOD (1182H) TB0FFCR (1183H) TB0RG0L (1188H) SFR (Address) Timer register TB0RG0H (1189H) TB0RG1L (118AH) TB0RG1H (118BH) TB0CP0L (118CH) Capture register TB0CP0H (118DH) TB0CP1L (118EH) TB0CP1H (118FH)
TMRB0
None
TMRB1
TB1IN0 (Share with PD0) TB1IN1 (Share with PD1) TB1OUT0 (Share with PD2) TB1OUT1 (Share with PD3) TB1RUN (1190H) TB1MOD (1192H) TB1FFCR (1193H) TB1RG0L (1198H) TB1RG0H (1199H) TB1RG1L (119AH) TB1RG1H (119BH) TB1CP0L (119CH) TB1CP0H (119DH) TB1CP1L (119EH) TB1CP1H (119FH)
92CM22-120
2007-02-16
Interrupt output
3.8.1
Internal data bus Register 0 INTTB00 Register 1 INTTB01
Internal data bus
Run/ clear 8 T4 Capture register 0 TB0CP0H/L Caputure register 1 TB0CP1H/L Timer flip-flop T16 16 32 TB0RUN
Prescaler clock: T0
2
4
Block Diagram
T1
(from TMRA01) TA1OUT control Selector T1 T4 T16 Count clock 16-bit up counter (UC10) TB0RUN TB0MOD Timer flip-flop control
TB0MOD
Timer flip-flop output
Capture, external interrupt
TB0FF0
TB0OUT0
TB0MOD
Figure 3.8.1 Block Diagram of TMRB0
92CM22-121
TB0MOD 16-bit comparator (CP10) Match detection 16-bit timer register TB0REG0H/L Register buffer 10 Internal data bus
Overflow interrupt INTTBOF0
Match detection
16-bit comparator (CP11)
16-bit timer register TB0RG1H/L
TB0RUN
TMP92CM22
2007-02-16
Intenal data bus
Interrupt output Internal data bus Register 0 INTTB00 Register 1 INTTB01 Internal data bus
Run/ clear 8 T4 Capture register 0 TB1CP0H/L Caputure register 1 TB1CP1H/L Timer flip-flop TB0FF0 Timer flip-flop control TB0FF1 T16 16 32 TB1RUN
Prescaler clock: T0
2
4
External interrupt input TB1MOD
T1
INT4 INT5 (from TMRA23) TA1OUT
Timer flip-flop output TB1OUT0 TB1OUT1
TB1IN0 TB1IN1 Selector T1 T4 T16 Count clock 16-bit up counter (UC1) TB1RUN TB1MOD
Capture, external interrupt
control
Figure 3.8.2 Block Diagram of TMRB1
92CM22-122
TB1MOD 16-bit comparator (CP12) Match detection 16-bit timer register TB1REG0H/L Register buffer 12 Internal data bus
TB1MOD
Overflow interrupt INTTBOF0
Match detection
16-bit comparator (CP13)
16-bit timer register TB1RG1H/L
TB1RUN
TMP92CM22
2007-02-16
Intenal data bus
TMP92CM22 3.8.2 Operation
(1) Prescaler The 5-bit prescaler generates the source clock for TMRB0. The prescaler clock (T0) is a divided clock (Divided by 8) from selected clock by the register SYSCR1 of clock gear. This prescaler can be started or stopped using TB0RUN. Counting starts when is set to 1; the prescaler is cleared to zero and stops operation when is cleared to 0. Table 3.8.2 show prescaler output clock resolution. Table 3.8.2 Prescaler Output Clock Resolution
Clock gear selection SYSCR1 000 (1/1) 001 (1/2) 010 (1/4) 011 (1/8) 100 (1/16) 1/8
Timer counter input clock TMRB prescaler - TB0MOD T1(1/2)
fc/16 fc/32 fc/64 fc/128 fc/256
T4 (1/8)
fc/64 fc/128 fc/256 fc/512 fc/1024
T16 (1/32)
fc/256 fc/512 fc/1024 fc/2048 fc/4096
(2) Up counter (UC10) UC10 is a 16-bit binary counter that counts up according to input from the clock specified by TB0MOD register. As the input clock, one of the prescaler internal clocks T1, T4, and T16 can be selected. Counting or stopping and clearing of the counter is controlled by timer operation control register TB0RUN. And an external clock from TB1IN0 pin can be selected in TB1MOD. When clearing is enabled, the up counter UC10 will be cleared to zero each time its value matches the value in the timer register TB0RG1H/L. Clearing can be enabled or disabled using TB0MOD. If clearing is disabled, the counter operates as a free-running counter. A timer overflow interrupt (INTTBOF0) is generated when UC10 overflow occurs.
92CM22-123
2007-02-16
TMP92CM22
(3) Timer registers (TB0RG0H/L and TB0RG1H/L) These two 16-bit registers are used to set the interval time. When the value in the up counter UC10 matches the value set in this timer register, the comparator match detect signal will go active. Setting data for both upper and lower timer registers TB0RG0H/L and TB0RG1H/L is always needed. For example, either using 2-byte data transfer instruction or using 1-byte data transfer instruction twice for lower 8 bits and upper 8 bits in order. The TB0RG0H/L timer register has a double-buffer structure, which is paired with register buffer 10. The value set in TB0RUN determines whether the double-buffer structure is enabled or disabled: It is disabled when = 0, and enabled when = 1. When the double buffer is enabled, data is transferred from the register buffer to the timer register when the values in the up counter (UC10) and the timer register TB0RG1H/L match. After a reset, TB0RG0H/L and TB0RG1H/L are undefined. If the 16-bit timer is to be used after a reset, data should be written to it beforehand. On a reset is initialized to 0, disabling the double buffer. To use the double buffer, write data to the timer register, set to 1, then write data to the register buffer as shown below. TB0RG0H/L and the register buffer both have the same memory addresses (001188H and 001189H) allocated to them. If = 0, the value is written to both the timer register and the register buffer. If = 1, the value is written to the register buffer only. The addresses of the timer registers are as follows:
TMRB0 TB0RG0H/L Upper 8 bits (TB0RG0H) 1189H Lower 8 bits (TB0RG0L) 1188H TB0RG1H/L Upper 8 bits (TB0RG1H) 118BH Lower 8 bits (TB0RG1L) 118AH
TMRB1 TB1RG0H/L Upper 8 bits (TB1RG0H) 1199H Lower 8 bits (TB1RG0L) 1198H TB1RG1H/L Upper 8 bits (TB1RG1H) 119BH Lower 8 bits (TB1RG1L) 119AH
The timer registers are write-only registers and thus cannot be read.
92CM22-124
2007-02-16
TMP92CM22
(4) Capture registers (TB0CP0H/L, TB0CP1H/L, TB1CP0H/L and TB1CP1H/L) These 16-bit registers are used to latch the values in the up counters UC10. Data in the capture registers should be read both upper and lower all 16 bits. For example, using 2-byte data transfer instruction or using 1-byte data transfer instruction twice for lower 8 bits and upper 8 bits in order. The addresses of the capture registers are as follows:
TMRB0 TB0CP0H/L Upper 8 bits (TB0CP0H) 118DH Lower 8 bits (TB0CP0L) 118CH TB0CP1H/L Upper 8 bits (TB0CP1H) 118FH Lower 8 bits (TB0CP1L) 118EH
TMRB1 TB1CP0H/L Upper 8 bits (TB1CP0H) 119DH Lower 8 bits (TB1CP0L) 119CH TB1CP1H/L Upper 8 bits (TB1CP1H) 119FH Lower 8 bits (TB1CP1L) 119EH
The capture registers are read-only registers and thus cannot be written.
(5) Capture and external interrupt control This circuit controls the timing to latch the value of up counter UC10 into TB0CP0H/L, TB0CP1H/L and generating for external interrupt. Interrupt timing of capture register and selection edge of external interrupt are set by TB0MOD. (TMRB0 does not include the selection edge of external interrupt.) External interrupt INT5 is fixed to rising edge. The value in the up counter (UC10) can be loaded into a capture register by software. Whenever 0 is programmed to TB0MOD, the current value in the up counter is loaded into capture register TB0CP0. It is necessary to keep the prescaler in Run mode (e.g., TB0RUN must be held at a value of 1).
92CM22-125
2007-02-16
TMP92CM22
(6) Comparators (CP10 and CP11) CP10 and CP11 are 16-bit comparators which compare the value in the up counter UC10 with the value set in TB0RG0H/L or TB0RG1H/L respectively, in order to detect a match. If a match is detected, the comparator generates an interrupt (INTTB00 or INTTB01 respectively). (7) Timer flip-flop (TB0FF0 and TB0FF1) These flip-flops (TB0FF0 and TB0FF1) are inverted by the match detect signals from the comparators and the latch signals to the capture registers. Inversion can be enabled and disabled for each element using TB0FFCR. After a reset the values of TB0FF0 and TB0FF1 are undefined. If "00" is programmed to TB0FFCR or , TB0FF0 will be inverted. If "01" is programmed to the capture registers, the value of TB0FF0 will be set to "1". If "10" is programmed to the capture registers, the value of TB0FF0 will be cleared to "0". The values of TB0FF0 can be output via the timer output pins TB0OUT0 (which is shared with PC6). Timer output should be specified using the port C function register.
92CM22-126
2007-02-16
TMP92CM22 3.8.3 SFRs
TMRB0 Run Register 7
TB0RUN (1180H) Bit symbol Read/Write After reset Function 0 Double buffer 0: Disable 1: Enable TB0RDE R/W 0 Always write "0". 0 IDLE2 0: Stop 1: Operate
6
-
5
4
3
I2TB0 R/W
2
TB0PRUN 0 TMRB0 Prescaler 0: Stop and clear 1: Run (Count)
1
0
TB0RUN R/W 0 Up counter UC10
Count operation 0 1 Stop and clear Count
Note: The values of bits 1, 4, and 5 of TB0RUN are undefined when read.
TMRB1 Run Register 7
TB1RUN (1190H) Bit symbol Read/Write After reset Function 0 Double buffer 0: Disable 1: Enable TB1RDE R/W 0 Always write "0". 0 IDLE2 0: Stop 1: Operate
6
-
5
4
3
I2TB1 R/W
2
TB1PRUN 0 TMRB1 Prescaler 0: Stop and clear 1: Run (Count)
1
0
TB1RUN R/W 0 Up counter UC12
Count operation 0 1 Stop and clear Count
Note: The values of bits 1, 4, and 5 of TB1RUN are undefined when read.
Figure 3.8.3 Register for TMRB
92CM22-127
2007-02-16
TMP92CM22
TMRB0 Mode Register 7
TB0MOD (1182H) Read-modify -write instruction is prohibited Bit symbol Read/Write After reset Function 0 Always write "0". - R/W 0 Always write "0".
6
-
5
TB0CP0I W 1 Software capture control
4
TB0CPM1 0 Capture timing 00: Disable 01: (Reserved)
3
TB0CPM0 0
2
TB0CLE R/W 0 Up counter control 0: Clear disable 1: Clear enable
1
TB0CLK1 0 00: (Reserved) 01: T1 10: T4 11: T16
0
TB0CLK0 0
TMRB0 source clock
0: Software 10: (Reserved) capturer 11: TA1OUT TA1OUT 1: Undefined
Input clock 00 01 10 11 Reserved T1 T4 T16
Clear up counter 0(UC0) 0 1 Disable Enable clearing on match with TB0RG1H/L
Capture/interrupt timing Capture control 00 01 10 11 Disable (Reserved) (Reserved) Capture to TB0CP0H/L at rising edge of TA1OUT Capture to TB0CP1H/L at falling edge of TA1OUT Software capture 0 1 Capture value of up counter to TB0CP0H/L Undefined
Figure 3.8.4 Register for TMRB
92CM22-128
2007-02-16
TMP92CM22
TMRB1 Mode Register 7
TB1MOD (1192H) Bit symbol Read/Write After reset Read-modify -write instruction is prohibited Function 0 0: Trigger disable 1: Trigger enable
Invert when UC12 is loaded into TB1CP1H/L Invert when UC12 matches with TB1RG1H/L
6
TB1ET1 R/W 0
5
TB1CP0I W 1 Software capture control 00:
4
TB1CPM1 0 Capture timing
3
TB1CPM0 0
2
TB1CLE R/W 0 Up counter control 0: Clear disable
1
TB1CLK1 0
0
TB1CLK0 0
TB1CT1
TB1FF1 Inversion trigger
TMRB1 source clock 00: TB1IN0 pin input 01: T1 10: T4 11: T16
Disable INT4 is rising edge TB1N0 TB1IN1 INT4 is falling edge
0: Software 01: capture 1: Undefined 10: 11:
1: Clear TB1IN0 TB1IN0 enable INT4 is falling edge TA1TRG TA1TRG INT4 is rising edge
Input clock 00 TB1IN0 pin input 01 T1 10 T4 11 T16 Clear up counter (UC12) 0 1 Clear disable Clear by matching with TB1RG1H/L
Capture/interrupt timing Capture control 00 Capture disable 01 Capture to TB1CP0H/L at rising edge of TB1IN0
Capture to TB1CP1H/L at rising edge of TB1IN1
INT4 control
Generate INT4 by TB1IN0 rising Generate INT4 by TB1IN0 falling
10 Capture to TB1CP0H/L at rising edge of TB1IN0
Capture to TB1CP1H/L at falling edge of TB1IN1
11 Capture to TB1CP0H/L at rising edge of TA1OUT Generate INT4
Capture to TB1CP1H/L at falling edge of TA1OUT by TB1IN0
rising
Software capture 0 1 Capture value of up counter to TB1CP0H/L Undefined
Figure 3.8.5 Register for TMRB
92CM22-129
2007-02-16
TMP92CM22
TMRB0 Flip-flop Control Register 7
TB0FFCR (1183H) Bit symbol Read/Write After reset Read-modify -write instruction is prohibited Function 1 Always write "11". - W 1 0 0: Trigger disable 1: Trigger enable
Invert when the UC10 value is loaded into TB0CP1H/L Invert when the UC10 value is loaded into TB0CP0H/L Invert when the UC10 matches with TB0RG1H/L
6
-
5
TB0C1T1
4
TB0C0T1 0 R/W
3
TB0E1T1 0
2
TB0E0T1 0
1
TB0FFC1 W* 1 TB0FF0 control 00: Invert 01: Set
0
TB0FFC0 1
TB0FF0 inversion trigger
Invert when 10: Clear the UC10 11: Don't care match with * Always read as "11". TB0RG0H/L
Timer flip-flop TB0 (TB0FF0) control 00 Invert 01 10 11 Set to "1". Set to "0". Don't care.
Inverted when the UC10 value matches the value in TB0RG0H/L 0 1 Disable inversion Enable inversion
Inverted when the UC10 value matches the value in TB0RG1H/L 0 1 Disable inversion Enable inversion
Inverted when the UC10 value is loaded into TB0CP0H/L 0 1 Disable inversion Enable inversion
Inverted when the UC10 value is loaded into TB0CP1H/L 0 1 Disable inversion Enable inversion
Figure 3.8.6 Register for TMRB
92CM22-130
2007-02-16
TMP92CM22
TMRB1 Flip-flop Control Register 7
TB1FFCR (1193H) Bit symbol Read/Write After reset Read-modify Function -write instruction is prohibited 1 TB1FF1 control 00: Invert 01: Set 10: Clear 11: Don't care * Always read as "11". TB1FF1C1 W* 1 0 0: Trigger disable 1: Trigger enable
Invert when the UC12 value is loaded into TB1CP1H/L. Invert when the UC12 value is loaded into TB1CP0H/L. Invert when the UC12 matches with TB1RG1H/L. Invert when the UC12 match with TB1RG0H/L.
6
TB1FF1C0
5
TB1C1T1
4
TB1C0T1 0 R/W
3
TB1E1T1 0
2
TB1E0T1 0
1
TB1FFC1 W* 1 TB1FF0 control 00: Invert 01: Set 10: Clear 11: Don't care
0
TB1FFC0 1
TB1FF0 inversion trigger
* Always read as "11".
Timer flip-flop TB1 (TB1FF0) control 00 01 10 11 Invert Set to "1". Set to "0". Don't care
Inverted when the UC12 value matches the value in TB1RG0H/L 0 1 Disable inversion Enable inversion
Inverted when the UC12 value matches the value in TB1RG1H/L 0 1 Disable inversion Enable inversion
Inverted when the UC12 value is loaded into TB1CP0H/L 0 1 Disable inversion Enable inversion
I Inverted when the UC12 value is loaded into TB1CP1H/L 0 1 Disable inversion Enable inversion
TB1FF1 control 00 01 10 11 Invert value of TB1FF1 Set TB1FF1 to "1". Set TB1FF1 to "0". Don't care
Figure 3.8.7 Register for TMRB
92CM22-131
2007-02-16
TMP92CM22
TMRB0 register 5 4
- W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined
7
TB0RG0L (1188H) bit Symbol Read/Write After reset TB0RG0H (1189H) bit Symbol Read/Write After reset TB0RG1L (118AH) bit Symbol Read/Write After reset TB0RG1H (118BH) bit Symbol Read/Write After reset TB0CP0L (118CH) bit Symbol Read/Write After reset TB0CP0H bit Symbol (118DH) Read/Write After reset TB0CP1L (118EH) bit Symbol Read/Write After reset TB0CP1H bit Symbol (118FH) Read/Write After reset
6
3
2
1
0
TMRB1 register 7
TB1RG0L (1198H) bit Symbol Read/Write After reset TB1RG0H (1199H) bit Symbol Read/Write After reset TB1RG1L (119AH) bit Symbol Read/Write After reset TB1RG1H (119BH) bit Symbol Read/Write After reset TB1CP0L (119CH) bit Symbol Read/Write After reset TB1CP0H bit Symbol (119DH) Read/Write After reset TB1CP1L (119EH) bit Symbol Read/Write After reset TB1CP1H bit Symbol (119FH) Read/Write After reset
6
5
4
- W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined - W Undefined
3
2
1
0
Note: All registers are prohibited to execute read-modify-write instruction.
Figure 3.8.8 Register for TMRB
92CM22-132
2007-02-16
TMP92CM22 3.8.4 Operation in Each Mode
(1) 16-bit interval timer mode Generating interrupts at fixed intervals in this example, the interval time is set the timer register TB0RG1H/L to generate the interrupt INTTB01.
76543210 TB0RUN INTETB0 TB0FFCR TB0MOD TB0RG1 TB0RUN 00XX-0X0 X100X000 11000011 001001* * * * * * * * * * * * * * * * * * (** = 01, 10, 11) Stop TMRB0. Enable INTTB01 and set interrupt level 4. Disable INTTB00. Disable the trigger. Set input clock to prescaler clock, and set capture function to disable. Set the interval time. (16 bits) Start TMRB0.
00XX-1X1
X : Don't care, - : No change
(2) 16-bit event counter mode In 16-bit timer mode as described in above, the timer can be used as an event counter by selecting the external clock (TB1IN0 pin input) as the input clock. Up counter counting up by rising edge of TB1IN0 pin input. And execution software capture and reading capture value enable reading count value.
76543210 TB1RUN PDCR PDFC INTETB1 TB1FFCR TB1MOD TB1RG1 TB1RUN 00XX-0X0 XXXX---0 XXXX---1 X100X000 11000011 00100100 * * * * * * * * * * * * * * * * Set INTTB11 to enable (Interrupt level4). Set INTTB00 to disable. Set trigger to disable. Set input clock to TB1IN0 pin input. Set number of count. (16 bits) Start TMRB1. Stop TMRB1. Set PD0 to TB1IN0 input mode.
00XX-1X1
X: Don't care, -: No change
Note: When used as an event counter, set the prescaler to "RUN" (TB1RUN = "1").
92CM22-133
2007-02-16
TMP92CM22
(3) 16-bit programmable pulse generation (PPG) output mode Square wave pulses can be generated at any frequency and duty ratio. The output pulse may be either low active or high active. The PPG mode is obtained by inversion of the timer flip-flop TB0FF0 that is to be enabled by the match of the up counter UC10 with timer register TB0RG0H/L or TB0RG1H/L and to be output to TB0OUT0. In this mode, the following conditions must be satisfied. (Set value of TB0RG0H/L) < (Set value of TB0RG1H/L)
Match with TB0RG0H/L (INTTB00 interrupt ) Match with TB0RG1H/L (INTTB01 interrupt) TB0OUT0 pin
Figure 3.8.9 Programmable Pulse Generation (PPG) Output Waveforms When the TB0RG0H/L double buffer is enabled in this mode, the value of register buffer 10 will be shifted into TB0RG0H/L at match with TB0RG1H/L. This feature makes easy the handling of low-duty waves.
Match with TB0RG0H/L Up counter = Q1 Match with TB0RG1H/L Shift in to TB0RG1H/L TB0RG0H/L (Compare value) Register buffer 10 Q1 Q2 Q2 Q3 Write TB0RG0H/L Up counter = Q2
Figure 3.8.10 Operation of Register Buffer
92CM22-134
2007-02-16
TMP92CM22
The following block diagram illustrates this mode.
TB0RUN Selector TB0IN0 T1 T4 T16 16-bit up counter UC10 Clear F/F (TB0FF0) TB0OUT0 (PPG output)
Matching 16-bit comparator 16-bit comparator
Selector
TB0RG0H/L
TB0RG0-WR Register buffer 10 TB0RUN Internal data bus TB0REG1H/L
Figure 3.8.11 Block Diagram of 16-Bit PPG Mode The following example shows how to set 16-bit PPG output mode:
76543210 TB0RUN 00XX-0X0 TB0RG0H/L * * * * * * * * * TB0RG1H/L * * TB0RUN * * * * * * * * * * * * * * * * * * * * * Disable the TB0RG0H/L double buffer and stop TMRB0. Set the duty ratio. (16 bits) Set the frequency. (16 bits) Enable the TB0RG0 double buffer. (The duty and frequency are changed on an INTTB01 interrupt.) Set the mode to invert TB0FF0 at the match with TB0RG0H/L/TB0RG1H?L. Clear TB0FF0 to 0. Set input clock to prescaler output clock and disable the capture function.
10XX-0X0
TB0FFCR TB0MOD
XX001110 001001* *
(** = 01, 10, 11) PCCR PCFC TB0RUN X1-X-X-- X1-X-X-- 10XX-1X1 Set PC6 to function as TB0OUT0. Start TMRB0.
X : Don't care, - : No change
92CM22-135
2007-02-16
TMP92CM22
(4) Capture function examples Used capture function, they can be applicable in many ways, for example: 1. 2. 3. 4. 1. One-shot pulse output from external trigger pulse Frequency measurement Pulse width measurement Measurement of difference time One-shot pulse output from external trigger pulse Set the up counter UC12 in free-running mode with the internal input clock, input the external trigger pulse from TB1IN0 pin, and load the value of up counter into capture register TB1CP0H/L at the rise edge of external trigger pulse. When the interrupt INT4 is generated at the rise edge of external trigger pulse, set the TB1CP0H/L value (c) plus a delay time (d) to TB1RG0H/L (= c + d), and set the above set value (c + d) plus a one-shot width (p) to TB1RG1H/L (= c + d + p). And, set "11" to timer flip-flop control register TB1FFCR. Set to trigger enable for be inverted timer flip-flop TB1FF0 by UC12 matching with TB1RG0H/L and with TB1RG1H/L. When interrupt INTTB11 occurs, this inversion will be disabled after one-shot pulse is output. The (c), (d), and (p) correspond to c, d, and p in Figure 3.8.12.
Set the counter in free-running mode. Count clock (Prescaler output clock) TB1IN0 pin input (External trigger pulse) Match with TB1RG0H/L c c+d c+d+p
Load into capture register 1 (TB1CP0H/L) and generate INT4. Inversion enable Inversion Set it to disables that enable inversion caused by loading into TB1CP1H/L. Delay time (d) Pulse width (p) Generate INTTB11.
Match with TB1RG1H/L
Timer ouput pin TB1OUT0
Figure 3.8.12 One-shot Pulse Output (with delay)
92CM22-136
2007-02-16
TMP92CM22
Example: To output a 2 [ms] one-shot pulse with a 3 [ms] delay to the external trigger pulse via the TB1IN0 pin.
* Clock state : Setting in Main Set free running. Count using T1. TB1MOD TB1FFCR XX101001 Load into TB1CP0H/L by rising edge of TB1IN0 pin input. XX000010 Clear TB1FF0 to 0. Disable inversion of TB1FF0. PDCR PDFC INTE45 INTETB1 TB1RUN XXXX-1-- XXXX-1XX X---X100 X000X000 -0XX-1X1 Set PD2 to function as the TB1OUT0 pin. Clock gear 1/1 (fc)
Enable INT4. Disable INTTB10 and INTTB11. Start TMRB0.
Setting in INT4 TB1RG0H/L TB1CP0H/L + 3 ms/T1 TB1RG1H/L TB1RG0H/L + 2 ms/T1 TB1FFCR XX--11-- Enable inversion of TB1FF0 when match with TB1RG0G/L or TB1RG1G/L. INTETB1 X100X--- Set INTTB11 to enable.
Setting in INTTB11 TB1FFCR XX--00-- Disable inversion of TB1FF0 when match with TB1RG0H/L or TB1RG1H/L. INTETB1 X000X--- Disable INTTB11. X : Don't care, - : No change
When delay time is unnecessary, invert timer flip-flop TB1FF0 when up counter value is loaded into capture register (TB1CP0H/L), and set the TB1CP0H/L value (c) plus the one-shot pulse width (p) to TB0RG1H/L when the interrupt INT4 occurs. The TB1FF0 inversion should be enable when the up counter (UC12) value matches TB1RG1H/L, and disabled when generating the interrupt INTTB11.
92CM22-137
2007-02-16
TMP92CM22
Count clock (Prescaler output clock) c TB1IN0 input (External trigger pulse) Match with TB1RG1H/L Inversion enable Timer output TB1OUT0 pin Pulse width (p) Set it to enable that inversion caused by loading into TB1CP0H/L.
c+p Load into capture register TB1CP0H/L generate INT4. Generate INTTB11. Load into capture register 1 TB1CP1H/L.
Set it to disable that inversion caused by loading into TB1CP1H/L.
Figure 3.8.13 One-shot Pulse Output (without delay) 2. Frequency measurement The frequency of the external clock can be measured in this mode. Frequency is measured by the 8-bit timers TMRA23 and the 16-bit timer/event counter. TMRA23 is used to setting of measurement time by inversion TA3FF. Counter clock in TMRB0 select TB1IN0 pin input, and count by external clock input. Set to TB1MOD = "11". The value of the up counter (UC12) is loaded into the capture register TB0CP0H/L at the rise edge of the timer flip-flop TA1FF of 8-bit timers (TMRA1), and into TB0CP1H/L at its fall edge. The frequency is calculated by difference between the loaded values in TB1CP0H/L and TB1CP1H/L when the interrupt (INTTA2 or INTTA3) is generates by either 8-bit timer.
Count clock (TB1IN0 pin input ) TA3FF Load into TB1CP0H/L Load into TB1CP1H/L INTTA2/INTTA3 C1 C2 C1 C2
C1
C2
Figure 3.8.14 Frequency Measurement For example, if the value for the level 1 width of TA3FF of the 8-bit timer is set to 0.5 s and the difference between the values in TB1CP0H/L and TB1CP1H/L is 100, the frequency is 100 / 0.5 s = 200 Hz.
92CM22-138
2007-02-16
TMP92CM22
3. Pulse width measurement This mode allows measuring the high level width of an external pulse. While keeping the 16-bit timer/event counter counting (Free running) with the prescaler output clock input, external pulse is input through the TB1IN0 pin. Then the capture function is used to load the UC12 values into TB1CP0H/L and TB1CP1H/L at the rising edge and falling edge of the external trigger pulse respectively. The interrupt INT4 occurs at the falling edge of TB1IN0. The pulse width is obtained from the difference between the values of TB1CP0H/L and TB1CP1H/L and the internal clock cycle. For example, if the prescaler output clock is 0.8 s and the difference between TB1CP0H/L and TB1CP1H/L is 100, the pulse width will be 100 x 0.8 s = 80 s. Additionally, the pulse width that is over the UC12 maximum count time specified by the clock source can be measured by changing software.
Count clock (Prescaler output clock) C1 TB1IN0 pin input (External pulse) Load into TB0CP0H/L Load into TB0CP1H/L INT4 C1 C2 C1 C2 C2
Figure 3.8.15 Pulse Width Measurement Note: Pulse Width measure by setting "10" to TB1MOD. The external interrupt INT4 is generated in timing of falling edge of TB1IN0 input. In other modes, it is generated in timing of rising edge of TB1IN0 input.
The width of low level can be measured from the difference between the first C2 and the second C1 at the second INT4 interrupt.
92CM22-139
2007-02-16
TMP92CM22
4. Measurement of difference time This mode is used to measure the difference in time between the rising edges of external pulses input through TB1IN0 and TB1IN1. Keep the 16-bit timer/event counter (TMRB1) counting (Free running) with the prescaler output clock, and load the UC12 value into TB1CP0H/L at the rising edge of the input pulse to TB1IN0. Then the interrupt INT4 is generated. Similarly, the UC012 value is loaded into TB1CP1H/L at the rising edge of the input pulse to TB1IN1, generating the interrupt INT5. The time difference between these pulses can be obtained by multiplying the value subtracted TB1CP0H/L from TB1CP1H/L and the internal clock cycle together at which loading the UC12 value into TB1CP0H/L and TB1CP1H/L has been done.
Count clock (Prescaler output clock) C1 TB1IN0 pin input TB1IN1 pin input Load into TB1CP0H/L Load intoTB1CP1H/L INT4 INT5 Difference time C2
Figure 3.8.16 Measurement of Difference Time
92CM22-140
2007-02-16
TMP92CM22
3.9
Serial Channels (SIO)
The TMP92CM22 includes 2 serial I/O channels. Each channel is called SIO0 and SIO1. For both channels either UART Mode (Asynchronous transmission) or I/O interface mode (Synchronous transmission) can be selected. * I/O interface mode Mode 0: For transmitting and receiving I/O data using the synchronizing signal SCLK for extending I/O.
Mode 1: 7-bit data * UART mode Mode 2: 8-bit data Mode 3: 9-bit data In mode 1 and mode 2 a parity bit can be added. Mode 3 has a wakeup function for making the master controller start slave controllers via a serial link (Multi-controller system). Figure 3.9.2 and Figure 3.9.3 are block diagrams for each channel. Each channel is structured in prescaler, serial clock generation circuit, receiving buffer and control circuit, and transfer buffer and control circuit. Serial channels 0 and 1 can be used independently. Both channels operate in the same function except for the following points; hence only the operation of channel 0 is explained below. Table 3.9.1 Differences between Channels 0 to 1 Channel 0
Pin name TXD0 (PF0) RXD0 (PF1)
CTS0 /SCLK0 (PF2)
Channel 1
TXD1 (PF3) RXD1 (PF4)
CTS1 /SCLK1 (PF5)
IrDA mode
Yes
No
This chapter contains the following sections: 3.9.1 Block Diagram 3.9.2 Operation of Each Circuit 3.9.3 SFRs 3.9.4 Operation in Each Mode 3.9.5 Support for IrDA Mode
92CM22-141
2007-02-16
TMP92CM22
*
Mode 0 (I/O interface mode) Bit0 1 2 3 4 5 6 7
Transfer direction
*
Mode 1 (7-bit UART mode) No parity Parity Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 Stop Parity Stop
*
Mode 2 (8-bit UART mode) No parity Parity Start Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 Stop Parity Stop
*
Mode 3 (9-bit UART mode) Start Wakeup Start Bit0 Bit0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 Bit8 Stop Stop
If bit8=1, denoted address (Select code). If bit8=0, denoted data.
Figure 3.9.1 Data Format
92CM22-142
2007-02-16
TMP92CM22 3.9.1
T0
Block Diagram
Prescaler 2 4 8 16 32 64 T2 T8 T32
Serial clock generation circuit BR0CR BR0CR BR0ADD Prescaler T0 T2 T8 T32 Selector TA0TRG (from TMRA0)
Selector
UART mode Selector
SIOCLK
BR0CR Baud rate generater fio
SC0MOD0 SC0MOD0 /2 Selector
SCLK0 input
I/O interface mode
(Shared with PF2) SC0CR Interrupt INTRX0 INTTX0 Serial channel interrupt control Transmission counter (UART only / 16) TXDCLK Transsmission control
CTS0
SCLK0 output
I/O interface mode
(Shared with PF2) SC0MOD0 (UART only / 16) RXDCLK Receive control SC0MOD0 SC0CR Parity control Receive counter
SC0MOD0
(Shared with PF2)
RXD0 (Shared with PF1)
Receive buffer 1 (Shift register)
RB8
Receive buffer 2 (SC0BUF)
Error flag
TB8
Transmission buffer (SC0BUF) TXD0 (Shared with PF0)
SC0CR Internal data bus
Figure 3.9.2 Block Diagram of SIO0
92CM22-143
2007-02-16
TMP92CM22
Prescaler T0 2 4 8 16 32 64 T2 T8 T32
Serial clock generation circuit BR1CR BR1CR BR1ADD Prescaler T0 T2 T8 T32 Selector TA0TRG (from TMRA0)
Selector
UART mode Selector
SIOCLK
BR1CR Baud rate generater fio
SC1MOD0 SC1MOD0 /2 Selector
SCLK1 input
I/O interface mode
(Shared with PF5) SC1CR Interrupt request INTRX1 INTTX1 Serial channel interrupt control Transmission counter (UART only / 16) TXDCLK Transmission control SC1CR Parity control SC1MOD0
CTS1
SCLK1 output
I/O interface mode
(Shared with PF5) SC1MOD0 (UART only / 16) RXDCLK Receive buffer SC1MOD0 Receive control
(Shared with PF5)
RXD1 (Shared with PF4)
Receive buffer 1 (Shift register)
RB8
Receive buffer 2 (SC1BUF)
Error flag
TB8
Transmission buffer (SC1BUF)
SC1CR Internal data bus
TXD1 (Shared with PF3)
Figure 3.9.3 Block Diagram of SIO1
92CM22-144
2007-02-16
TMP92CM22 3.9.2 Operation of Each Circuit
(1) Prescaler There is a 6-bit prescaler for generating a clock to SIO0. The clock selected using SYSCR1 is divided by 8 and input to the prescaler as T0. The prescaler can be run only case of selecting the baud rate generator as the serial transfer clock. Table 3.9.2 shows prescaler clock resolution into the baud rate generator. Table 3.9.2 Prescaler Clock Resolution to Baud Rate Generator
- Clock Gear SYSCR1
000(1/1) 001(1/2) fc 010(1/4) 011(1/8) 100(1/16) 1/8
-
T0 fc/8 fc/16 fc/32 fc/64 fc/128
Clock Resolution BR0CR
T2 fc/32 fc/64 fc/128 fc/256 fc/512 T8 fc/128 fc/256 fc/512 fc/1024 fc/2048 T32 fc/512 fc/1024 fc/2048 fc/4096 fc/8192
The serial interface baud rate generator selects between 4 clock inputs: T0, T2, T8, and T32 among the prescaler outputs.
92CM22-145
2007-02-16
TMP92CM22
(2) Baud rate generator The baud rate generator is a circuit that generates transmission and receiving clocks that determine the transfer rate of the serial channels. The input clock to the baud rate generator, T0, T2, T8, or T32, is generated by the 6-bit prescaler which is shared by the timers. One of these input clocks is selected using the BR0CR field in the baud rate generator control register. The baud rate generator includes a frequency divider, which divides the frequency by 1 or N + (16 - K)/16 to 16 values, determining the transfer rate. The transfer rate is determined by the settings of BR0CR and BR0ADD. * In UART mode The settings BR0ADD are ignored. The baud rate generator divides the selected prescaler clock by N (N = 1, 2, 3 ... 16), which is set in BR0CR. (2) When BR0CR = 1 The N + (16 - K)/16 division function is enabled. The baud rate generator divides the selected prescaler clock by N + (16 - K)/16 using the value of N (N = 2, 3 ... 15) set in BR0CR and the value of K (K = 1, 2, 3 ... 15) set in BR0ADD. Note: If N = 1 and N = 16, the N + (16 - K)/16 division function is disabled. Clear BR0CR register to "0". In I/O interface mode The N + (16 - K)/16 division function is not available in I/O interface mode. Clear BR0CR to 0 before dividing by N. The method for calculating the transfer rate when the baud rate generator is used is explained below. * UART mode Baud rate = * Input clock of baud rate generator Frequency divider for baud rate generator I/O interface mode Baud rate = Input clock of baud rate generator Frequency divider for baud rate generator /2 / 16 (1) When BR0CR = 0
*
92CM22-146
2007-02-16
TMP92CM22
* Integer divider (N divider) For example, when the fC = 39.3216 MHz, the input clock frequency = T2, the frequency divider N (BR0CR) = 8, and BR0CR = 0, the baud rate in UART mode is as follows: Clock state Clock gear: Baud rate = fC/32 8 1/1 (fC)
/ 16
= 39.3216 x 106 / 16 / 8 / 16 = 9600 (bps) Note: * The N + (16 - K)/16 division function is disabled and setting BR0ADD is invalid. N + (16 - K)/16 divider (UART mode only) Accordingly, when fC = 31.9488 MHz, the input clock frequency = T2, the frequency divider N (BR0CR) = 6, K (BR0ADD) = 8, and BR0CR = 1, the baud rate is as follows: * Clock state Clock gear: Baud rate = 1/1 (fC)
fC/32 / 16 (16 - 8) 6+ 16 8 6 = 31.9488 x 10 / 32 / (6 + 16 ) / 16 = 9600 (bps)
Table 3.9.3 show examples of UART mode transfer rates. Additionally, the external clock input is available in the serial clock (Serial channels 0 and 1). The method for calculating the baud rate is explained below: * In UART mode Baud rate = External clock input frequency / 16 It is necessary to satisfy (External clock input cycle) 4/fSYS * In I/O interface mode Baud rate = External clock input frequency It is necessary to satisfy (External clock input cycle) 16/fSYS
92CM22-147
2007-02-16
TMP92CM22
Table 3.9.3 UART Baud Rate Selection (when using baud rate generater and BR0CR = 0)
Unit (kbps)
Input Clock fSYS [MHz] Frequency Divider
9.8304 12.2880 14.7456 19.6608 22.1184 24.5760 2 4 8 10 5 A 2 3 6 C 1 2 4 8 10 3 1 2 4 5 8 A 10
T0 (fSYS/4)
76.800 38.400 19.200 9.600 38.400 19.200 115.200 76.800 38.400 19.200 307.200 153.600 76.800 38.400 19.200 115.200 384.000 192.000 96.000 76.800 48.000 38.400 24.000
T2 (fSYS/16)
19.200 9.600 4.800 2.400 9.600 4.800 28.800 19.200 9.600 4.800 76.800 38.400 19.200 9.600 4.800 28.800 96.000 48.000 24.000 19.200 12.000 9.600 6.000
T8 T32 (fSYS/64) (fSYS/256)
4.800 2.400 1.200 0.600 2.400 1.200 7.200 4.800 2.400 1.200 19.200 9.600 4.800 2.400 1.200 7.200 24.000 12.000 6.000 4.800 3.000 2.400 1.500 1.200 0.600 0.300 0.150 0.600 0.300 1.800 1.200 0.600 0.300 4.800 2.400 1.200 0.600 0.300 1.800 6.000 3.000 1.500 1.200 0.750 0.600 0.375
Note 1: Transfer rates in I/O interface mode are eight times faster than the values given above.
In UART mode, TMRA match detect signal (TA0TRG) can be used for serial transfer clock. Method for calculating the timer output frequency which is needed when outputting trigger of timer TA0TRG frequency = Baud rate x 16 Note: The TMRA0 match detect signal cannot be used as the transfer clock in I/O Interface mode.
92CM22-148
2007-02-16
TMP92CM22
(3) Serial clock generation circuit This circuit generates the basic clock for transmitting and receiving data. * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the basic clock is generated by dividing the output of the baud rate generator by 2, as described previously. In SCLK input mode with the setting SC0CR = 1, the rising edge or falling edge will be detected according to the setting of the SC0CR register to generate the basic clock. * In UART mode The SC0MOD0 setting determines whether the baud rate generator clocks, the internal system clock fIO, the trigger output signal from TMRA0 or the external clock (SCLK0 pin) is used to generate the basic clock SIOCLK. (4) Receiving counter The receiving counter is a 4-bit binary counter used in UART mode that counts up the pulses of the SIOCLK clock. It takes 16 SIOCLK pulses to receive 1 bit of data; each data bit is sampled three times - on the 7th, 8th, and 9th clock cycles. The value of the data bit is determined from these three samples using the majority rule. For example, if the data bit is sampled respectively as 1, 0, and 1 on 7th, 8th, and 9th clock cycles, the received data bit is taken to be 1. A data bit sampled as 0, 0, and 1 are taken to be 0. (5) Receiving control * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the RXD0 pin is sampled on the rising or falling edge of the shift clock which is output on the SCLK0 pin according to the SC0CR setting. In SCLK input mode with the setting SC0CR = 1, the RXD0 pin is sampled on the rising or falling edge of the SCLK input, according to the SC0CR setting. * In UART mode The receiving control block has a circuit that detects a start bit using the majority rule. Received bits are sampled three times; when two or more out of three samples are 0, the bit is recognized as the start bit and the receiving operation commences. The values of the data bits that are received are also determined using the majority rule.
92CM22-149
2007-02-16
TMP92CM22
(6) The receiving buffers To prevent overrun errors, the receiving buffers are arranged in a double-buffer structure. Received data is stored one bit at a time in receiving buffer 1 (which is a shift register). When 7 or 8 bits of data have been stored in receiving buffer 1, the stored data is transferred to receiving buffer 2 (SC0BUF); this causes an INTRX0 interrupt to be generated. The CPU only reads receiving buffer 2 (SC0BUF). Even before the CPU reads receiving buffer 2 (SC0BUF), the received data can be stored in receiving buffer 1. However, unless receiving buffer 2 (SC0BUF) is read before all bits of the next data are received by receiving buffer 1, an overrun error occurs. If an overrun error occurs, the contents of receiving buffer 1 will be lost, although the contents of receiving buffer 2 and SC0CR will be preserved. SC0CR is used to store either the parity bit - added in 8-bit UART mode - or the most significant bit (MSB) - in 9-bit UART mode. In 9-bit UART mode the wake-up function for the slave controller is enabled by setting SC0MOD0 to 1; in this mode INTRX0 interrupts occur only when the value of SC0CR is 1. (7) Transmission counter The transmission counter is a 4-bit binary counter that is used in UART mode and which, like the receiving counter, counts the SIOCLK clock pulses; a TXDCLK pulse is generated every 16 SIOCLK clock pulses.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Figure 3.9.4 Generation of Transmission Clock (8) Transmission controller * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the data in the transmission buffer is output one bit at a time to the TXD0 pin on the rising or falling edge of the shift clock which is output on the SCLK0 pin, according to the SC0CR setting. In SCLK input mode with the setting SC0CR = 1, the data in the transmission buffer is output one bit at a time on the TXD0 pin on the rising or falling edge of the SCLK0 input, according to the SC0CR setting. * In UART mode When transmission data sent from the CPU is written to the transmission buffer, transmission starts on the rising edge of the next TXDCLK, generating a transmission shift clock TXDSFT.
92CM22-150
2007-02-16
TMP92CM22
Handshake function Use of CTS0 pin allows data to be sent in units of one data format; thus, overrun errors can be avoided. The handshake function is enabled or disabled by the SC0MOD0 setting. When the CTS0 pin condition is high level, after completed the current data transmission, data transmission is halted until the CTS0 pin state is low again. However, the INTTX0 interrupt is generated, and it requests the next send from data to the CPU. The next data is written in the transmission buffer and data transmission is halted. Though there is no RTS pin, a handshake function can be easily configured by setting any port assigned to be the RTS function. The RTS should be output "High" to request send data halt after data receive is completed by software in the receive interrupt routine.
TMP92CM22
TMP92CM22
TXD
CTS
RXD
RTS (Any port)
Transmission side
Receiving side
Figure 3.9.5 Handshake Function
Timing of writing data to transmission buffer
CTS
Send is suspended a from a to b. b 13 14 15 16 1 2 3 14 15 16 1 2 3
SIOCLK TXDCLK TXD Start bit Bit0
Note 1:
If the CTS signal goes high during transmission, will be stop next transmission data after completion of the current transmission.
Note 2:
Transmission starts on the first falling edge of the TXDCLK clock after the CTS signal has fallen.
Figure 3.9.6 CTS (Clear to send) Signal Timing
92CM22-151
2007-02-16
TMP92CM22
(9) Transmission buffer The transmission buffer (SC0BUF) shifts out and sends the transmission data written from the CPU form the least significant bit in order. When all the bits are shifted out, the transmission buffer becomes empty and generates an INTTX0 interrupt. (10) Parity control circuit When SC0CR in the serial channel control register is set to 1, it is possible to transmit and receive data with parity. However, parity can be added only in 7-bit UART mode or 8-bit UART mode. The SC0CR field in the serial channel control register allows either even or odd parity to be selected. In the case of transmission, parity is automatically generated when data is written to the transmission buffer SC0BUF. The data is transmitted after the parity bit has been stored in SC0BUF in 7-bit UART mode or in SC0MOD0 in 8-bit UART mode. SC0CR and SC0CR must be set before the transmission data is written to the transmission buffer. In the case of receiving, data is shifted into receiving buffer 1, and the parity is added after the data has been transferred to receiving buffer 2 (SC0BUF), and then compared with SC0BUF in 7-bit UART mode or with SC0CR in 8-bit UART mode. If they are not equal, a parity error is generated and the SC0CR flag is set. (11) Error flags Three error flags are provided to increase the reliability of data reception. 1. Overrun error If all the bits of the next data item have been received in receiving buffer 1 while valid data still remains stored in receiving buffer 2 (SC0BUF), an overrun error is generated. The below is a recommended flow when the overrun-error is generated. (INTRX interrupt routine) 1) Read receiving buffer 2) Read error flag 3) if = "1" then 4) Set to disable receiving (Program "0" to SC0MOD0) 5) Wait to terminate current frame 6) Read receiving buffer 7) Read error flag 8) Set to enable receiving (Program "1" to SC0MOD0) 9) Request to transmit again 10) Other
92CM22-152
2007-02-16
TMP92CM22
2. Parity error The parity generated for the data shifted into receiving buffer 2 (SC0BUF) is compared with the parity bit received via the RXD pin. If they are not equal, a parity error is generated. Framing error The stop bit for the received data is sampled three times around the center. If the majority of the samples are 0, a framing error is generated. (12) Timing generation 1. In UART mode Receiving Mode
Interrupt generation timing Framing error generation timing Parity error generation timing Overrun error generation timing
3.
9 Bits
Center of last bit (Bit8) Center of stop bit - Center of last bit (Bit8)
8 Bits + Parity
Center of last bit (Parity bit) Center of stop bit Center of last bit (Parity bit) Center of last bit (Parity bit)
8 Bits, 7 Bits + Parity, 7 Bits
Center of stop bit Center of stop bit
Center of stop bit Center of stop bit
Note1: In 9 Bits mode and 8 Bits + Parity mode, interrupts coincide with the ninth bit pulse. Thus, when servicing the interrupt, it is necessary to wait for a 1-bit period (to allow the stop bit to be transferred) to allow checking for a framing error. Note2: The higher the transfer rate, the later than the middle receive interrupts and errors occur.
Transmission Mode
Interrupt generation timing
9 Bits
Just before stop bit is transmitted
8 Bits + Parity
8 Bits, 7 Bits + Parity, 7 Bits
2.
In I/O interface mode
SCLK output mode SCLK input mode SCLK output mode SCLK input mode Immediately after last bit data. (See Figure 3.9.19.) Immediately after rise of last SCLK signal rising mode, or immediately after fall in falling mode. (See Figure 3.9.20.) Timing used to transfer received to data receive buffer 2 (SC0BUF) (e.g., immediately after last SCLK). (See Figure 3.9.21.) Timing used to transfer received data to receive buffer 2 (SC0BUF) (e.g., immediately after last SCLK). (See Figure 3.9.22.)
Transmission interrupt timing Receiving interrupt timing
92CM22-153
2007-02-16
TMP92CM22 3.9.3 SFRs
7
SC0MOD0 (1202H) Bit symbol Read/Write After reset Function 0 Transfer data bit8 0 0 0 Wakeup function 0: Disable 1: Enable Handshake Receive control function control 0: Receive 0: CTS disable disable 1: Receive enable 1: CTS enable TB8
6
CTSE
5
RXE
4
WU R/W
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
Serial transmission mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transmission clock (UART) 00: Timer A0 trigger 01: Baud rate generator 10: Internal clock fIO 11: External clcok (SCLK0 input)
Serial transmission clock source (UART) 00 01 10 11 TMRA0 trigger output signal Baud rate generator Internal clock fIO External clock (SCLK0 input)
Note: The clock selection for the I/O interface mode is controlled by the serial control register (SC0CR). Serial transmission mode 00 01 10 11 Wakeup function 9-bit UART 0 1 Interrupt generated when data is received Interrupt generated only when SC0CR = 1 Other modes UART mode I/O interface mode 7-bit mode 8-bit mode 9-bit mode
Don't care
Receiving function 0 1 Receive disabled Receive enabled
Handshake function ( CTS pin) 0 Disabled (Always transferable)
1 Enabled Transmission data bit8
Figure 3.9.7 Serial Mode Control Register 0 (for SIO0 and SC0MOD0)
92CM22-154
2007-02-16
TMP92CM22
7
SC1MOD0 (120AH) Bit symbol Read/Write After reset Function 0 Transfer data bit8 TB8
6
CTSE 0
5
RXE 0
4
WU R/W 0 Wakeup function 0: Disable 1: Enable
3
SM1 0
2
SM0 0
1
SC1 0
0
SC0 0
Handshake Receive function control control 0: Receive 0: CTS disable 1: Receive disable enable 1: CTS enable
Serial transmission mode 00: I/O interface mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transmission clock (UART) 00: Timer A0 trigger 01: Baud rate generator 10: Internal clock fIO 11: External clcok (SCLK1 input)
Serial transmission clock source (UART) 00 01 10 11 Note: TMRA0 trigger output signal Baud rate generator Internal clock fIO External clock (SCLK1 input) The clock selection for the I/O interface mode is controlled by the serial control register (SC1CR). I/O interface mode 7-bit mode UART mode 8-bit mode 9-bit mode
Serial transmission mode 00 01 10 11 Wakeup function 9-bit UART 0 1 Interrupt generated when data is received Interrupt generated only when SC1CR = 1 Other modes
Don't care
Receiving function 0 1 Receive disabled Receive enabled
Handshake function ( CTS pin) 0 Disabled (Always transferable)
1 Enabled Transmission data bit8
Figure 3.9.8 Serial Mode Control Register (for SIO1 and SC1MOD)
92CM22-155
2007-02-16
TMP92CM22
7
SC0CR (1201H) Bit symbol Read/Write After reset Function RB8 R Undefined Received data bit8
6
EVEN R/W 0 Parity 0: Odd 1: Even
5
PE 0 Parity addition 0: Disable 1: Enable
4
OERR 0 Overrun
3
PERR 0 1: Error Parity
2
FERR 0 Framing
1
SCLKS R/W 0 0: SCLK0 1: SCLK0
0
IOC 0 0: Baud rate generator 1: SCLK0 pin input
R (Cleared to 0 when read)
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Edge selection for SCLK0 pin (I/O mode) 0 1 Transmits and receivers data on rising edge of SCLK0. Transmits and receivers data on falling edge SCLK0. Cleared to 0 when read
Framing error flag Parity error flag Overrun error flag Parity addition enables 0 1 Disabled Enabled
Even parity addition/check 0 1 Odd parity Even parity
Received data bit8
Note: As all error flags are cleared after reading, do not test only a single bit with a bit-testing instruction.
Figure 3.9.9 Serial Control Register (for SIO0 and SC0CR)
92CM22-156
2007-02-16
TMP92CM22
7
SC1CR (1209H) Bit symbol Read/Write After reset Function RB8 R Undefined Received data bit8
6
EVEN R/W 0 Parity 0: Odd 1: Even
5
PE 0 Parity addition 0: Disable 1: Enable
4
OERR 0 Overrun
3
PERR 0 1: Error Parity
2
FERR 0 Framing
1
SCLKS R/W 0 0: SCLK1 1: SCLK1
0
IOC 0 0: Baud rate generator 1: SCLK1 pin input
R (Cleared to 0 when read)
I/O interface input clock selection 0 1 Baud rate generator SCLK1 pin input
Edge selection for SCKL1 pin (I/O mode) 0 1 Transmits and receives data on rising edge of SCLK1. Transmits and receives data on falling edge of SCLK1. Cleared to 0 when read
Framing error flag Parity error flag Overrun error flag Parity addition enables 0 1 Disabled Enabled
Even parity addition/check 0 1 Odd parity Even parity
Received data bit8
Note: As all error flags are cleared after reading, do not test only a single bit with a bit-testing instruction.
Figure 3.9.10 Serial Control Register (for SIO1 and SC1CR)
92CM22-157
2007-02-16
TMP92CM22
7
BR0CR (1203H) Bit symbol Read/Write After reset Function 0 Always write "0". -
6
BR0ADDE 0
5
BR0CK1 0
4
BR0CK0 R/W 0
3
BR0S3 0
2
BR0S2 0
1
BR0S1 0
0
BR0S0 0
+ (16 - K)/16 00: T0 division 01: T2 0: Disable 10: T8 1: Enable 11: T32
Divided frequency setting
+ (16 - K)/16 divisions enable 0 1 Disable Enable
Setting the input clock of baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
7
BR0ADD (1204H) Bit symbol Read/Write After reset Function
6
5
4
3
BR0K3 0
2
BR0K2 R/W 0
1
BR0K1 0
0
BR0K0 0
Sets frequency divisor "K" (Divided by N + (16 - K)/16).
Sets baud rate generator frequency divisor BR0CR = 1 BR0CR BR0ADD 0000 0001 (K = 1) Disable 1111 (K = 15) ~ 0000 (N = 16) or 0001 (N = 1) Disable 0010 (N = 2) ~ 1111 (N = 15) Disable Divided by N + (16-K) /16 Divided by N BR0CR = 0 0001 (N = 1) (UART only) 1111 (N = 15) 0000 (N = 16) ~
Note1:Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode x I/O mode x x
The baud rate generator can be set to "1" in UART mode only when the +(16-K)/16 division function is not used. Do not use in I/O interface mode. Note2:Set BR0CR to 1 after setting K (K = 1 to 15) to BR0ADD when + (16-K)/16 division function is used. Writes to unused bits in the BR0ADD register do not affect operation, and undefined data is read from these unused bits.
Figure 3.9.11 Baud Rate Generator Control (for SIO0, BR0CR, and BR0ADD)
92CM22-158
2007-02-16
TMP92CM22
7
BR1CR (120BH) Bit symbol Read/Write After reset Function 0 Always write "0". -
6
BR1ADDE 0
5
BR1CK1 0
4
BR1CK0 R/W 0
3
BR1S3 0
2
BR1S2 0
1
BR1S1 0
0
BR1S0 0
+ (16 - K)/16 00: T0 division 01: T2 0: Disable 10: T8 1: Enable 11: T32
Divided frequency setting
+ (16 - K)/16 divisions enable 0 1 Disabled Enabled
Input clock selection for baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
7
BR1ADD (120CH) Bit symbol Read/Write After reset Function
6
5
4
3
BR1K3 0
2
BR1K2 R/W 0
1
BR1K1 0
0
BR1K0 0
Set frequency divisor "K" (Divided by N + (16 - K)/16).
Baud rate generator frequency divisor setting BR1CR = 1 BR1CR BR1ADD 0000 0001 (K = 1) Disable 1111 (K = 15) ~ 0000 (N = 16) or 0001 (N = 1) Disable 0010 (N = 2) ~ 1111 (N = 15) BR1CR = 0 0001 (N = 1) (UART only) to 1111 (N = 15) 0000 (N = 16) Disable Divided by N + (16 - K) / 16 Divided by N
Note1:Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode x I/O mode x x
The baud rate generator can be set to "1" in UART mode only when the +(16-K)/16 division function is not used. Do not use in I/O interface mode. Note2:Set BR1CR to 1 after setting K (K = 1 to 15) to BR1ADD when +(16-K)/16 division function is used. Writes to unused bits in the BR1ADD register do not affect operation, and undefined data is read from these unused bits.
Figure 3.9.12 Baud Rate Generater Control (for SIO1, BR1CR, and BR1ADD)
92CM22-159
2007-02-16
TMP92CM22
7 TB7 SC0BUF (1200H) 7 RB7 Note:
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0 (for transmission)
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0 (for receiving)
Prohibit read-modify-write for SC0BUF
Figure 3.9.13 Serial Transmission/Receiving Buffer Register (for SIO0 and SC0BUF)
7
SC0MOD1 Bit symbol (1205H) Read/Write After reset Function I2S0 R/W 0 IDLE2 0: Stop 1:Run
6
FDPX0 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.14 Serial Mode Control Regsiter (for SIO and SC0MOD1)
7 TB7 SC1BUF (1208H) 7 RB7 Note:
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0 (for transmission)
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0 (for receiving)
Prohibit read-modify-write for SC1BUF
Figure 3.9.15 Serial Transmission/Receiving Buffer Register (for SIO1 and SC1BUF)
7
SC1MOD1 Bit symbol (120DH) Read/Write After reset Function I2S1 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX1 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.16 Serial Mode Control Regsiter (for SIO and SC1MOD1)
92CM22-160
2007-02-16
TMP92CM22 3.9.4 Operation in Each Mode
(1) Mode 0 (I/O interface mode) This mode allows an increase in the number of I/O pins available for transmitting data to or receiving data from an external shift register. This mode includes the SCLK output mode to output synchronous clock SCLK and SCLK input mode to input external synchronous clock SCLK.
Output extension TMP92CM22 Shift register A B TXD SCLK Port SI SCK RCK C D E F G H Port S/ L SCLK CLOCK RXD QH Input extension TMP92CM22 Shift register A B C D E F G H
TC74HC595 or equivalent
TC74HC165 or equivalent
Figure 3.9.17 Example of SCLK Output Mode Connection
Output extension TMP92CM22 Shift register A B TXD SCLK Port SI SCK RCK C D E F G H Port S/ L SCLK CLOCK RXD QH Input extension TMP92CM22 Shift register A B C D E F G H
TC74HC595 or equivalent External clock
TC74HC165 or equivalent External clock
Figure 3.9.18 Example of SCLK Output Mode Connection
92CM22-161
2007-02-16
TMP92CM22
1. Transmission In SCLK output mode 8-bit data and a synchronous clock are output on the TXD0 and SCLK0 pins respectively each time the CPU writes the data to the transmission buffer. When all data is outputted, INTES0 will be set to generate the INTTX0 interrupt.
Timing of writing transmission data SCLK0 output ( = 0 rising mode) SCLK0 output ( = 1 falling mode) TXD0 ITX0C (INTTX0 interrupt request) Bit0 Bit1 Bit6 Bit7
(Internal clock timinig)
Figure 3.9.19 Transmission Operation in I/O Interface Mode (SCLK0 output mode) In SCLK input mode, 8-bit data is output from the TXD0 pin when the SCLK0 input becomes active after the data has been written to the transmission buffer by the CPU. When all data is outputted, INTES0 will be set to generate INTTX0 interrupt.
SCLK0 input ( = 0 rising mode) SCLK0 input ( = 1 falling mode) TXD0 ITX0C (INTTX0 interrupt request) Bit0 Bit1 Bit5 Bit6 Bit7
Figure 3.9.20 Transmission Operation in I/O Interface Mode (SCLK0 input mode)
92CM22-162
2007-02-16
TMP92CM22
2. Receiving In SCLK output mode, the synchronous clock is outputted from SCLK0 pin and the data is shifted to receiving buffer 1. This starts when the receive interrupt flag INTES0 is cleared by reading the received data. When 8-bit data are received, the data will be transferred to receiving buffer 2 (SC0BUF according to the timing shown below) and INTES0 will be set to generate INTRX0 interrupt. The outputting for the first SCLK0 starts by setting SC0MOD0 to 1.
IRX0C (INTRX0 interrupt request) SCLK0 output ( = 0: rising mode) SCLK0 output ( = 1: falling mode) RXD0 Bit0 Bit1 Bit6 Bit7
Figure 3.9.21 Receiving Operation in I/O Interface Mode (SCLK0 output mode) In SCLK input mode, the data is shifted to receiving buffer 1 when the SCLK input becomes active after the receive interrupt flag INTES0 is cleared by reading the received data. When 8-bit data is received, the data will be shifted to receiving buffer 2 (SC0BUF according to the timing shown below) and INTES0 will be set again to be generate INTRX0 interrupt.
SCLK0 input ( = 0: rising mode) SCLK0 input ( = 1: falling mode) RXD1 IRX0C (INTRX0 interrupt request) Bit0 Bit1 Bit5 Bit6 Bit7
Figure 3.9.22 Receiving Operation in I/O Interface Mode (SCLK0 input mode) Note: If receiving, set to the receive enable state (SC0MOD0 = 1) in both SCLK input mode and output mode.
92CM22-163
2007-02-16
TMP92CM22
3. Transmission and receiving (Full duplex mode) When the full duplex mode is used, set the level of receive interrupt to "0" and set enable the interrupt level (1 to 6) to the transfer interrupts. In the transfer interrupt program, the receiving operation should be done like the below example before setting the next transfer data. Example: Channel 0, SCLK output Baud rate = 9600 bps fC = 4.9152 MHz
* Clock state: Clock gear 1/1(fc) Main routine 76543210 INTES0 PFCR PFFC SC0MOD0 SC0MOD1 SC0CR BR0CR SC0MOD0 SC0BUF 00010000 -----101 -----1-1 00000000 11000000 00000000 00011000 00100000 Set to I/O interface mode. Set to full duplex mode. Output SCLK, select rising edge. Set to 9600 bps. Set receive to enable. Set transmission data. Set transmission interrupt level to 1, and disable receiving interrupt level to 0. Set to PF0 (TXD0), PF1 (RXD0), and PF2 (SCLK0).
Transmission interrupt routine Acc SC0BUF SC0BUF X: Don't care, -: No change Read receiving data. Set transmission data.
92CM22-164
2007-02-16
TMP92CM22
(2) Mode 1 (7-bit UART mode) 7-bit UART mode is SC0MOD0 to 01. selected by setting serial channel mode register
In this mode, a parity bit can be added. Use of a parity bit is enabled or disabled by the setting of the serial channel control register SC0CR bit; whether even parity or odd parity will be used is determined by the SC0CR setting when SC0CR is set to 1 (Enabled). Example: When transmitting data of the following format, the control registers should be set as described below. This explanation applies to channel 0.
Start Bit0 1 2 3 4 5 6
Even parity
Stop
Transfer direction (Transfer speed 2400 bps at fC = 39.3216 MHz) * Clock state: 76543210 PFCR PFFC SC0MOD SC0CR BR0CR INTES0 SC0BUF -------1 -------1 X0-X0101 X11XXX00 00101000 1100---- Set PF0 to as TXD0 pin. Set to 7-bit UART mode. Add even parity. Set to 2400 bps. Set INTTX0 interrupt to enable, set to level 4. Set transmission data. Clock gear 1/1(fc)
X : Don't care, - : No change
(3) Mode 2 (8-bit UART mode) 8-bit UART mode is selected by setting SC0MOD0 to 10. In this mode, a parity bit can be added (Use of a parity bit is enabled or disabled by the setting of SC0CR); whether even parity or odd parity will be used is determined by the SC0CR setting when SC0CR is set to 1 (Enabled). Example: When receiving data of the following format, the control registers should be set as described below.
Start Bit0 1 2 3 4 5 6 7
Odd parity
Stop
Transfer direction (Transfer speed 9600 bps at fC = 39.3216 MHz) * Clock state: Main routine 76543210 PFCR SC0MOD SC0CR BR0CR INTES0 ------0- -01X1001 X01XXX00 00011000 ----1100 Set PF1 (RXD0) to input pin. Set to 8-bit UART mode, set receives to enable. Add odd parity. Set to 9600 bps. Set INTTX0 interrupt to enable, set to level 4. Clock gear 1/1(fc)
Interrupt routine processing Acc if Acc Acc SC0CR AND 00011100 0 then ERROR SC0BUF Check for error. Read receiving data.
X : Don't care, - : No change
92CM22-165
2007-02-16
TMP92CM22
(4) Mode 3 (9-bit UART mode) 9-bit UART mode is selected by setting SC0MOD0 to 11. In this mode parity bit cannot be added. In the case of transmission the MSB (9th bit) is programmed to SC0MOD0. In the case of receiving it is stored in SC0CR. When the buffer is written and read, the MSB is read or written first, before the rest of the SC0BUF data. Wakeup function In 9-bit UART mode, the wakeup function for slave controllers is enabled by setting SC0MOD0 to 1. The interrupt INTRX0 occurs only when = 1.
TXD Master
RXD
TXD Slave 1
RXD
TXD Slave 2
RXD
TXD Slave 3
RXD
Note:
The TXD pin of each slave controller must be in open-drain output mode.
Figure 3.9.23 Serial Link Using Wakeup Function
92CM22-166
2007-02-16
TMP92CM22
Protocol 1. 2. 3. Select 9-bit UART mode on the master and slave controllers. Set the SC0MOD0 bit on each slave controller to 1 to enable data receiving. The master controller transmits one-frame data including the 8-bit select code for the slave controllers. The MSB (Bit8) is set to "1".
Start Bit0 1 2 3 4 5 6 7 8 "1" Stop
Select code of slave controller
4. 5.
Each slave controller receives the above frame. If it matches with own select code, clears bit to "0". The master controller transmits data to the specified slave controller whose SC0MOD0 bit is cleared to "0". The MSB (Bit8) is cleared to "0".
Start Bit0 1 2 3 Data 4 5 6 7 Bit8 "0" Stop
6.
The other slave controllers (whose bits remain at 1) ignore the received data because their MSB (Bit8 or ) are set to "0", disabling INTRX0 interrupts. The slave controller ( bit = "0") can transmit data to the master controller, and it is possible to indicate the end of data receiving to the master controller by this transmission.
92CM22-167
2007-02-16
TMP92CM22
Example: To link two slave controllers serially with the master controller using the system clock fIO as the transfer clock.
TXD Master
RXD
TXD Slave 1
RXD
TXD Slave 2
RXD
Select code 00000001
Select code 00001010
*
Main routine PFCR PFFC INTES0 SC0MOD0 SC0BUF
Master controller setting
------01 ------X1 11001101 10101110 00000001
Set PF0 to TXD0, and set PF1 to RXD0 pin. Set INTTX0 to enable, and set interrupt level to level 4. Set INTRX0 to enable, and set interrupt level to level 5. Set to 9-bit UART mode, and set transfer clock to fIO. Set select code of slave 1.
Interrupt routine (INTTX0) SC0MOD0 SC0BUF 0------- Set TB8 to "0". Set transmission data.
*
Main routine PFCR PFFC INTES0
Slave setting

------00 ------X1 11011110 00111110
Set PF0 to TXD (open-drain output), and PC1 to RXD.
Set INTTX0 and INTRX0 to enable. Set to = "1" in 9-bit UART mode transfer clock fIO.
SC0MOD0
Interrupt routine (INTRX0) Acc SC0BUF if Acc = Select code Then SC0MOD0 ---0---- Clear to = "0".
92CM22-168
2007-02-16
TMP92CM22 3.9.5 Support for IrDA Mode
SIO0 includes support for the IrDA 1.0 infrared data communication specification. Figure 3.9.24 shows the block diagram.
Transmission data
IR modulator Modem
TXD0
IR transmitter & LED IR output IR module
SIO0 Receive data
IR demodulator
RXD0
IR receiver IR input
TMP92CM22
Figure 3.9.24 Block Diagram of IrDA (1) Modulation of transmission data When the transmission data is 0, output "H" level with either 3/16 or 1/16 times for width of baud-rate (Selectable in software). When data is "1", modem output "L" level.
Transmission data Output after modulation
Start
0
1
0
0
1
1
0
0
Stop
Figure 3.9.25 Example of Modulation of Transmission Data (2) Modulation of receiving data When the receive data has the effective high level pulse width (Software selectable), the modem outputs "0" to SIO0. Otherwise modem outputs "1" to SIO0. Receive pulse logic is selectable by SIRCR.
Receiving pulse = "0" Receiving pulse = "1" Data after modulation Start 1 0 0 1 0 1 1 0 Stop
Figure 3.9.26 Example of Modulation of Receiving Data
92CM22-169
2007-02-16
TMP92CM22
(3) Data format Format of transmission/receiving must set to data length 8-bit, without parity bit, 1 bit of stop bit. Any other settings don't guarantee the normal operation. (4) SFR Figure 3.9.27 shows the control register SIRCR. If change setting this register, must set it after set operation of transmission/receiving to disable (Both and of this register should be clear to 0). Any changing for this register during transmission or receiving operation doesn't guarantee the normal operation. The following example describes how to set this register: 1) 2) 3) 4) SIO setting LD (SIRCR), 07H LD (SIRCR), 37H Transmission/receiving ; The modem operates as follows: * * (5) Notes 1. Making baud rate when using IrDA In baud rate during using IrDA, must set "01" to SC0MOD0 in SIO by using baud rate generator. TA0TRG, fIO, SCLK0 input of except for it can not using. 2. Output pulse width and baud rate generator during transmission IrDA As the IrDA 1.0 physical layer specification, the data transfer speed and infra-red pulse width is specified. Table 3.9.4 Specification of Transfer Rate and Pulse Width Transfer Modulation Rate
2.4 kbps 9.6 kbps 19.2 kbps 38.4 kbps 57.6 kbps 115.2 kbps RZI RZI RZI RZI RZI RZI
; Set SIO side. ; Set receiving effect pulse width to 16X. ; TXEN, RXEN enable the transmission and receiving.
SIO0 starts transmitting. IR receiver starts receiving.
Transfer Rate Tolerance (% of Rate)
0.87 0.87 0.87 0.87 0.87 0.87
Minimum of Pulse Width
1.41 s 1.41 s 1.41 s 1.41 s 1.41 s 1.41 s
Typical of Pulse Width 3/16
78.13 s 19.53 s 9.77 s 4.88 s 3.26 s 1.63 s
Maximum of Pulse Width
88.55 s 22.13 s 11.07 s 5.96 s 4.34 s 2.23 s
The infra-red pulse width is specified either baud rate T x 3/16 or 1.6 s (1.6 s is equal to T x 3/16 pulse width when baud rate is 115.2 kbps). The TMP92CM22 has function which is selectable the transmission pulse width either 3/16 or 1/16. But T x 1/16 pulse width can be selected when the baud rate is equal or less than 38.4 kbps only. When 57.6 kbps and 115.2 kbps, the output pulse width should not be set to T x 1/16.
92CM22-170
2007-02-16
TMP92CM22
As the same reason, + (16 - K)/16 division function in the baud rate generator of SIO0 cannot be used to generate 115.2 kbps baud rate. Also when the 38.4 kbps and 1/16 pulse width, + (16 - K)/16 division function cannot be used. Table 3.9.5 shows baud rate and pulse width for (16 - K)/16 division function. Table 3.9.5 Baud Rate and Pulse Width for (16 - K)/16 Division Function
Output Pulse Width
T x 3/16 T x 1/16
Baud Rate 115.2 kbps
x -
57.6 kbps
-
38.4 kbps
x
19.2 kbps :
9.6 kbps
2.4 kbps
Can be used (16 - K)/16 division function.
x: Cannot be used (16 - K)/16 division function. -: Cannot be set to T x 1/16 pulse width.
7
SIRCR (1207H) Bit symbol Read/Write After reset Function 0 PLSEL
6
RXSEL 0
data
5
TXEN 0
Transmission 0: Disable 1: Enable
4
RXEN R/W 0
Receiving operation 0: Disable 1: Enable
3
SIRWD3 0
2
SIRWD2 0
1
SIRWD1 0
0
SIRWD0 0
Selection Receiving transmission data logic pulse width 0: "H" pulse 0: 3/16 1: 1/16 1: "L" pulse
Select receiving effective pulse width Set effective pulse width for equal or more than 2x x (Value + 1) + 100 ns Can be set: 1 to 14 Cannot be set: 0, 15
Select receiving effective pulse width Formula: Receiving effective pulse width 2x x (Setting value + 1) + 100 ns x = 1/fSYS 0000 0001 1110 1111 ~ Pulse width of equal or more than 30x + 100 ns is effective. Cannot be set. Enable of receiving operation 0 1 Disable receiving operation. (Received input is ignored.) Enable receiving operation. Enable of transmission operation 0 1 Disable transmission operation (Input from SIO is ignored.) Enable transmission operation. Select transmission pulse width 0 1 Pulse width of 3/16 Pulse width of 1/16 Note: If a pulse width complying with the IrDA 1.0 standard (1.6s min.) can be guaranteed with a low baud rate, setting this bit to "1" will result in reduced power dissipation. Cannot be set. Pulse width of equal or more than 4x + 100 ns is effective.
Figure 3.9.27 IrDA Control Register
92CM22-171
2007-02-16
TMP92CM22
3.10 Serial Bus Interface (SBI)
The TMP92CM22 has a 1-channel serial bus interface. Serial bus interface (SBI0) include following 2 operation modes. * * I2C bus mode (Multi master) Clocked-synchronous 8-bit SIO mode
The serial bus interface is connected to an external device through P91 (SDA) and P92 (SCL) in the I2C bus mode; and through P90 (SCK), P91 (SO), and P92 (SI) in the clocked-synchronous 8-bit SIO mode. Each pin is specified as follows.
P9ODE
I C bus mode Clocked-synchronous 8-bit SIO mode X: Don't care Note: When using SI and SCK input function, set P9FC to "0" (Function setting).
2
P9CR
11X 011 010
P9FC
11X 011 010 (Note)
11 XX
3.10.1
Configuration
INTSBE0 interrupt requests SCL SCK SIO clock control I/O control Divider Transfer control circuit SIO data control SO SI P90 (SCK)
P91 (SO/SDA)
I C bus clock sync. Noise canceller + Control
2
Shift register
I C bus data control
2
P92 (SI/SCL) Noise canceller SDA
SBI0CR2/ SBI0SR SBI0 control register 2/ SBI0 status register
2
I2C0AR I C0 bus address register
SBI0BR SBI0 data buffer register
SBI0CR1 SBI0 control register 1
SBI0BR0, 1 SBI0 baud rate registers 0 and 1
Figure 3.10.1 Serial Bus Interface 0 (SBI0)
92CM22-172
2007-02-16
TMP92CM22 3.10.2 Control
The following registers are used to control the serial bus interface and monitor the operation status. * Serial bus interface 0 control register 1 (SBI0CR1) * Serial bus interface 0 control register 2 (SBI0CR2) * Serial bus interface 0 data buffer register (SBI0DBR) * I2C bus 0 address register (I2C0AR) * Serial bus interface 0 status register (SBI0SR) * Serial bus interface 0 baud rate register 0 (SBI0BR0) * Serial bus interface 0 baud rate register 1 (SBI0BR1) The above registers differ depending on a mode to be used. Refer to Section 3.10.4 "I2C Bus Mode Control Register" and 3.10.7 "Clocked-synchronous 8-Bit SIO Mode Control".
3.10.3
Data Format in I2C Bus Mode
Data format in I2C bus mode is shown Figure 3.10.3. (a)
Addressing format 1 RA /C WK 1 to 8 bits Data 1 A C K 1 or more 1 to 8 bits Data 1 A CP K
8 bits S Slave address 1
(b)
Addressing format (with restart)
8 bits S Slave address 1
1 RA /C WK
1 to 8 bits Data 1 or more
1 A CS K
8 bits Slave address 1
1 RA /C WK
1 to 8 bits Data 1 or more
1 A CP K
(c)
Free data format (transfer format transfer from master device to slave device) 1 A CP K
8 bits S Slave address 1 S:
1 A C K
1 to 8 bits Data
1 A C K 1 or more
1 to 8 bits Data
Start condition
R/ W : Direction bit ACK: P: Acknowledge bit Stop condition
Figure 3.10.2 Data Format in I2C Bus Mode
92CM22-173
2007-02-16
TMP92CM22 3.10.4 I2C Bus Mode Control Register
The following registers are used to control and monitor the operation status when using the serial bus interface (SBI) in the I2C bus mode. Serial Bus Interface Control Register 1 7
SBI0CR1 (1240H) Bit symbol Read/Write After reset ReadFunction modify-write instruction is prohibited. 0 BC2
6
BC1 W 0
5
BC0
4
ACK R/W
3
2
SCK2 W 0
1
SCK1
0
SCK0/ SWRMON R/W 0/1 (Note 3)
0
Select number of transferred bits (Note 1)
0 Acknowledge mode specification 0: Not generate 1: Generate
0
Internal serial clock selection and software reset monitor (Note 2)
Internal serial clock selection at write 000 001 010 011 100 101 110 111 n=5 n=6 n=7 n=8 n=9 n = 10 n = 11 (Reserved) - kHz (Note4) - kHz (Note4) - kHz (Note4) 75.8 kHz 38.5 kHz 19.4 kHz 9.73 kHz (Reserved) System clock: fSYS fSYS = 20 MHz (output to SCL pin) Frequency = fSYS 2 +8
n
[Hz]
Software reset state monitor at read 0 1 During software reset Initial data
Acknowledge mode selection 0 1 Not generate clock pulse for acknowledge signal Generate clock for acknowledge signal
Select number of bits transferred = 0 Number of clock pulses 8 1 2 3 4 5 6 7 Data length = 1 Number of clock pulses 9 2 3 4 5 6 7 8 Data length
000 001 010 011 100 101 110 111 Note 1: Note 2: Note 3:
8 1 2 3 4 5 6 7
8 1 2 3 4 5 6 7
Set the to "000" before switching to a clocked-synchronous 8-bit SIO mode. For the frequency of the SCL line clock, see section 3.10.5 (3) "Serial clock". Initial data of SCK0 is "0", SWRMON is "1".
2 2 2
Note 4: This I C bus circuit does not support Fast mode, it supports standard mode only. Although the I C bus circuit itself allows the setting of a baud rate over 100 kbps, the compliance with the I C specification is not guaranteed in that case.
Figure 3.10.3 Register for I2C Bus Mode
92CM22-174
2007-02-16
TMP92CM22
Serial Bus Interface Control Register 2 7
SBI0CR2 (1243H) Bit symbol Read/Write After reset Readmodify-write instruction is prohibited. Function 0 Master/ slave selection 0 MST
6
TRX W
5
BB 0
4
PIN 1 Release INTSBE0 interrupt request
3
SBIM1 W (Note 1)
2
SBIM0
1
SWRST1 W (Note 1)
0
SWRST0
Transmitter/ Start/stop receiver condition selection generation
0 0 Serial bus interface operation mode selection (Note 2) 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved)
0 0 Software reset control write "10" and "01" in order, then an internal software reset signal is generated.
Serial bus interface operating mode selection (Note 2) 00 01 10 11 Port mode (Serial bus interface output disabled) Clocked-synchronous 8-bit SIO mode I2C bus mode (Reserved)
INTSBE0 interrupt request 0 1 - Release interrupt request
Start/stop condition generation 0 1 Generates the stop condition Generates the start condition
Transmitter/receiver selection 0 1 Receiver Transmitter
Master/slave selection 0 1 Slave Master
Note 1: Note 2:
Reading this register function as SBI0SR register. Switch a mode to port mode after confirming that the bus is free. Switch a mode between I C bus mode and clocked-synchronous 8-bit SIO mode after confirming that input signals via port are high level.
2
Figure 3.10.4 Register for I2C Bus Mode
92CM22-175
2007-02-16
TMP92CM22
Serial Bus Interface Status Register 7
SBI0SR (1243H) Bit symbol Read/Write After reset ReadFunction modify-write instruction is prohibited. 0 Master/ slave status selection monitor 0
2
6
TRX
5
BB 0
4
PIN R 1 INTSBE0 interrupt request monitor
3
AL 0 Arbitration lost detection monitor 0: - 1: Detected
2
AAS 0
Slave address match detection monitor 0: Undetected 1: Detected
1
AD0 0
GENERAL CALL detection monitor 0: Undetected 1: Detected
0
LRB 0 Last received bit monitor 0: 0 1: 1
MST
Transmitter/ I C bus status receiver monitor status selection monitor
Last received bit monitor 0 1 Last received bit was 0. Last received bit was 1.
GENERAL CALL detection monitor 0 1 Undetected GENERAL CALL detected
Slave address match detection monitor 0 1 Undetected Slave address match or GENERAL CALL detected
Arbitration lost detection monitor 0 1 - Arbitration lost
INTSBE0 interrupt request monitor 0 1
2
Interrupt requested Interrupt released
I C bus status monitor 0 1 Free Busy
Transmitter/receiver status monitor 0 1 Receiver Transmitter
Master/slave status monitor 0 1 Slave Master
Note: Writing in this register functions as SBI0CR2.
Figure 3.10.5 Register for I2C Bus Mode
92CM22-176
2007-02-16
TMP92CM22
Serial Bus Interface Baud Rate Register 0 7
SBI0BR0 (1244H) Readmodify-write instruction is prohibited. Bit symbol Read/Write After reset Function - W 0 Always write "0".
6
I2SBI0 R/W 0 IDLE2 0: Stop 1: Run
5
4
3
2
1
0
Operation during IDLE 2 mode 0 Stop 1 Run
Serial Bus Interface Baud Rate Register 1 7
SBI0BR1 (1245H) Readinstruction is prohibited. Bit symbol Read/Write After reset 0 Internal clock 0: Stop 1: Run P4EN W 0 Always write "0".
6
-
5
4
3
2
1
0
modify-write Function
Operation during IDLE 2 mode 0 Stop 1 Run
Sirial Bus Interface Data Buffer Register 7
SBI0DBR (1241H) Readmodify-write instruction is prohibited. Bit symbol Read/Write After reset DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Receiving)/W (Transmission) Undefined
Note 1: When writing transmission data, start from the MSB (Bit7). Receiving data is placed from LSB (Bit0). Note 2: SBI0DBR can't be read the written data. Therefore read-modify-write instruction (e.g., "BIT" instruction) is prohibited.
I2C Bus Address Register 7
I2C0AR (1242H) Bit symbol Read/Write After reset ReadFunction modify-write instruction is prohibited. 0 0 0 0 SA6
6
SA5
5
SA4
4
SA3 W
3
SA2 0
2
SA1 0
1
SA0 0
0
ALS 0 Address recognition mode specification
Slave address selection for when device is operating as slave device
Address recognition mode specification 0 1 Slave address recognition Non slave address recognition
Figure 3.10.6 Register for I2C Bus Mode
92CM22-177
2007-02-16
TMP92CM22 3.10.5 Control in I2C Bus Mode
(1) Acknowledge mode specification Set the SBI0CR1 to 1 for operation in the acknowledge mode. The TMP92CM22 generates an additional clock pulse for an acknowledge signal when operating in master mode. In the transmitter mode during the clock pulse cycle, the SDA pin is released in order to receive the acknowledge signal from the receiver. In the receiver mode during the clock pulse cycle, the SDA pin is set to the low in order to generate the acknowledge signal. Clear the to 0 for operation in the non-acknowledge mode, the TMP92CM22 does not generate a clock pulse for the acknowledge signal when operating in the master mode. (2) Select number of transfer bits The SBI0CR1 is used to select a number of bits for next transmission/ receiving data. Since the is cleared to 000 as a start condition, a slave address and direction bit are transferred in 8 bits. Other than these, the retains a specified value. (3) Serial clock 1. Clock source The SBI0CR1 is used to select a maximum transfer frequency outputted on the SCL pin in master mode. Set the baud rates, which have been calculated according to the formula below, to meet the specifications of the I2C bus, such as the smallest pulse width of tLOW.
tHIGH tLOW 1/fscl
tLOW = 2
n-1
/fSBI /fSBI + 8/fSBI
SBI0CR1 000 001 010 011 100 101 110
n 5 6 7 8 9 10 11
tHIGH = 2
n-1
fscl = 1/(tLOW + tHIGH) f = nSBI 2 +8
Note: fSBI shows fSYS.
Figure 3.10.7 Clock Source
92CM22-178
2007-02-16
TMP92CM22
2. Clock synchronization In the I2C bus mode, in order to wired-AND a bus, a master device which pulls down a clock line to low level, in the first place, invalidate a clock pulse of another master device which generates a high-level clock pulse. The master device with a high-level clock pulse needs to detect the situation and implement the following procedure. The TMP92CM22 has a clock synchronization function for normal data transfer even when more than one master exists on the bus. The example explains the clock synchronization procedures when two masters simultaneously exist on a bus.
Wait counting high-level width of a clock pulse Start couting high-level width of a clock pulse Internal SCL output (Master A) Internal SCL output (Master B) SCL line a b c
Reset a counter of high-level width of a clock pulse
Figure 3.10.8 Clock Synchronization As master A pulls down the internal SCL output to the low level at point "a", the SCL line of the bus becomes the low level. After detecting this situation, master B resets a counter of high-level width of an own clock pulse and sets the internal SCL output to the low level. Master A finishes counting low-level width of an own clock pulse at point "b" and sets the internal SCL output to the high level. Since master B holds the SCL line of the bus at the low level, master A waits for counting high-level width of an own clock pulse. After master B finishes counting low-level width of an own clock pulse at point "c" and master A detects the SCL line of the bus at the high level, and starts counting high level of an own clock pulse. The clock pulse on the bus is determined by the master device with the shortest high-level width and the master device with the longest low-level width from among those master devices connected to the bus. (4) Slave address and address recognition mode specification When the TMP92CM22 is used as a slave device, set the slave address and to the I2C0AR. Clear the to "0" for the address recognition mode. (5) Master/slave selection Set the SBI0CR2 to "1" for operating the TMP92CM22 as a master device. Clear the SBI0CR2 to "0" for operation as a slave device. The is cleared to "0" by the hardware after a stop condition on the bus is detected or arbitration is lost.
92CM22-179
2007-02-16
TMP92CM22
(6) Transmitter/receiver selection Set the SBI0CR2 to "1" for operating the TMP92CM22 as a transmitter. Clear the to "0" for operation as a receiver. In slave mode, when transfer data in addressing format, when received slave address is same value with setting value to I2C0AR, or GENERAL CALL is received (All 8-bit data are "0" after a start condition), the is set to "1" by the hardware if the direction bit (R/ W ) sent from the master device is "1", and is cleared to "0" by the hardware if the bit is "0". In the master mode, after an acknowledge signal is returned from the slave device, the is cleared to "0" by the hardware if a transmitted direction bit is "1", and is set to "1" by the hardware if it is "0". When an acknowledge signal is not returned, the current condition is maintained. The is cleared to "0" by the hardware after a stop condition on the bus is detected or arbitration is lost. (7) Start/stop condition generation When programmed "1111" to SBI0CR2 in during SBI0SR is "0", slave address and direction bit which are set to SBI0DBR and start condition are output on a bus. And it is necessary to set transmitted data to the data buffer register (SBI0DBR) and set "1" to beforehand.
SCL line SDA line Start condition 1 A6 2 A5 3 A4 4 A3 5 A2 6 A1 7 A0 8 R/ W Acknowledge signal 9
Slave address and direction bit
Figure 3.10.9 Generation of Start Condition and Slave Address When programmed "0" to SBI0CR2 and "111" to in during SBI0SR is "1", start a sequence of stop condition output. Do not modify the contents of until a stop condition is generated on a bus.
SCL line SDA line Stop condition
Figure 3.10.10 Generation of Stop Condition The state of the bus can be ascertained by reading the contents of SBI0SR. SBI0SR will be set to 1 (Bus busy status) if a start condition has been detected on the bus, and will be cleared to 0 if a stop condition has been detected (Bus free status).
92CM22-180
2007-02-16
TMP92CM22
(8) Interrupt service requests and interrupt cancellation When a serial bus interface interrupt request 0 (INTSBE0) occurs, the SBI0SR2 is cleared to "0". During the time that the SBI0SR2 is "0", the SCL line is pulled down to the low level. The is cleared to "0" when end of transmission or receiving 1 word of data. And when writing data to SBI0DBR or reading data from SBI0DBR, is set to "1". The time from the being set to "1" until the SCL line is released takes tLOW. In the address recognition mode ( = 0), is cleared to "0" when the received slave address is the same as the value set at the I2C0AR or when a GENERAL CALL is received (All 8-bit data are "0" after a start condition). Although SBI0CR2 can be set to "1" by the program, the is not clear it to "0" when it is programmed "0". (9) Serial bus interface operation mode selection SBI0CR2 is used to specify the serial bus interface operation mode. Set SBI0CR2 to "10" when the device is to be used in I2C bus mode after confirming pin condition of serial bus interface to "H". Switch a mode to port after confirming a bus is free. (10) Arbitration lost detection monitor Since more than one master device can exist simultaneously on the bus in I2C bus mode, a bus arbitration procedure has been implemented in order to guarantee the integrity of transferred data. Data on the SDA line is used for I2C bus arbitration. The following shows an example of a bus arbitration procedure when two master devices exist simultaneously on the bus. Master A and master B output the same data until point "a". After master A outputs "L" and master B, "H", the SDA line of the bus is wire-AND and the SDA line is pulled down to the low level by master A. When the SCL line of the bus is pulled up at point b, the slave device reads the data on the SDA line, that is, data in master A. A data transmitted from master B becomes invalid. The state in master B is called "ARBITRATION LOST". Master B device that loses arbitration releases the internal SDA output in order not to affect data transmitted from other masters with arbitration. When more than one master sends the same data at the first word, arbitration occurs continuously after the second word.
SCL (Line) Internal SDA output (Master A) Internal SDA output (Master B) SDA line a b Set internal SDA output to "1" after arbitration has been lost.
Figure 3.10.11 Arbitration Lost
92CM22-181
2007-02-16
TMP92CM22
The TMP92CM22 compares the levels on the bus's SDA line with those of the internal SDA output on the rising edge of the SCL line. If the levels do not match, arbitration is lost and SBI0SR is set to "1". When SBI0SR is set to "1", SBI0SR are cleared to "00" and the mode is switched to slave receiver mode. Thus, clock output is stopped in data transfer after setting = "1". SBI0SR is cleared to "0" when data is written to or read from SBI0DBR or when data is written to SBI0CR2.
Internal SCL Master output A Internal SDA output Internal SCL Master output B Internal SDA output 1 2 3 4 5 6 7 8 9 1 2 3 4
D7A
D6A
D5A
D4A
D3A
D2A
D1A
D0A
D7A'
D6A'
D5A'
D4A'
Stop the clock pulse 1 2 3 4
D7B
D6B
Keep internal SDA output to high level as losing arbitration
Accessed to SBI0DBR or SBI0CR2
Figure 3.10.12 Example of when TMP92CM22 is a Master Device B (D7A = D7B, D6A = D6B) (11) Slave address match detection monitor SBI0SR operates following in during slave mode; In address recognition mode (e.g., when I2C0AR = "0"), when received GENERAL CALL or same slave address with value set to I2C0AR, SBI0SR is set to "1". When = "1", SBI0SR is set to "1" after the first word of data has been received. SBI0SR is cleared to "0" when data is written to SBI0DBR or read from SBI0DBR. (12) GENERAL CALL detection monitor SBI0SR operates following in during slave mode; when received GENERAL CALL (all 8-bit data is "0", after a start condition), SBI0SR is set to "1". And SBI0SR is cleared to "0" when a start condition or stop condition on the bus is detected. (13) Last received bit monitor The value on the SDA line detected on the rising edge of the SCL line is stored in the SBI0SR. In the acknowledge mode, immediately after an INTSBE0 interrupt request has been generated, an acknowledge signal is read by reading the contents of the SBI0SR.
92CM22-182
2007-02-16
TMP92CM22
(14) Software reset function The software reset function is used to initialize the SBI circuit, when SBI is rocked by external noises, etc. When write first "10" next "01" to SBI0CR2, reset signal is inputted to serial bus interface circuit, and circuit is initialized. All command registers except SBI0CR2 and status flag except SBI0CR2 are initialized to value of just after reset. SBI0CR1 is set to "1" automatically when completed initialization of serial bus interface. (15) Serial bus interface data buffer register (SBI0DBR) The received data can be read and transmission data can be written by reading or writing SBI0DBR. In the master mode, after the slave address and the direction bit are set in this register, the start condition is generated. (16) I2C bus address register (I2C0AR) I2C0AR is used to set the slave address when the TMP92CM22 functions as a slave device. The slave address outputted from the master device is recognized by setting the I2C0AR to "0". And, the data format becomes the addressing format. When set to "1", the slave address is not recognized, the data format becomes the free data format. (17) Baud rate register (SBI0BR1) Write "1" to baud rate circuit control register SBI0BR1 before using I2C bus. (18) Setting register for IDLE2 mode operation (SBI0BR0) SBI0BR0 is the register setting operation/stop during IDLE2 mode. Therefore, setting is necessary before the HALT instruction is executed.
92CM22-183
2007-02-16
TMP92CM22 3.10.6 Data Transfer in I2C Bus Mode
(1) Device initialization In first, set the SBI0BR1, SBI0CR1. Set SBI0BR1 to "1" and clear bits 7 to 5 and 3 in the SBI0CR1 to "0". Next, set a slave address and the ( = "0" when an addressing format) to the I2C0AR. And, write "000" to SBI0CR2, "1" to , "10" to and "00" to . Set initialization status to slave receiver mode by this setting. (2) Start condition and slave address generation 1. Master mode In the master mode, the start condition and the slave address are generated as follows. In first, check a bus free status (when SBI0SR = "0"). Set the SBI0CR1 to "1" (Acknowledge mode) and specify a slave address and a direction bit to be transmitted to the SBI0DBR. When SBI0SR = "0", the start condition are generated by writing "1111" to SBI0CR2. Subsequently to the start condition, nine clocks are output from the SCL pin. While eight clocks are output, the slave address and the direction bit which are set to the SBI0DBR. At the 9th clock, the SDA line is released and the acknowledge signal is received from the slave device. An INTSBE interrupt request generate at the falling edge of the 9th clock. The is cleared to "0". In the master mode, the SCL pin is pulled down to the low level while is "0". When an interrupt request is generated, the is changed according to the direction bit only when an acknowledge signal is returned from the slave device. 2. Slave mode In the slave mode, the start condition and the slave address are received. After the start condition is received from the master device, while eight clocks are output from the SCL pin, the slave address and the direction bit that are output from the master device are received. When a GENERAL CALL or the same address as the slave address set in I2C0AR is received, the SDA line is pulled down to the low level at the 9th clock, and the acknowledge signal is output. An INTSBE interrupt request is generated on the falling edge of the 9th clock. The is cleared to "0". In slave mode the SCL line is pulled down to the low level while the = "0".
92CM22-184
2007-02-16
TMP92CM22
SCL line SDA line
1 A6 Start condition
2 A5
3 A4
4 A3
5 A2
6 A1
7 A0
8 R/ W
9 ACK Acknowledge signal from a slave device
Slave address + Direction bit
INTSBE0 interrupt request Output of master Output of slave
Figure 3.10.13 Start Condition and Slave Address Generation (3) 1-word data transfer Check the by the INTSBE0 interrupt process after the 1-word data transfer is completed, and determine whether the mode is a master or slave. 1. If = "1" (Master mode) Check the and determine whether the mode is a transmitter or receiver. When the = "1" (Transmitter mode) Check the . When is "1", a receiver does not request data. Implement the process to generate a stop condition (Refer to 3.10.6 (4)) and terminate data transfer. When the is "0", the receiver is requests new data. When the next transmitted data is 8 bits, write the transmitted data to SBI0DBR. When the next transmitted data is other than 8 bits, set the and write the transmitted data to SBI0DBR. After written the data, becomes "1", a serial clock pulse is generated for transferring a new 1-word of data from the SCL pin, and then the 1-word data is transmitted. After the data is transmitted, an INTSBE interrupt request generates. The becomes "0" and the SCL line is pulled down to the low level. If the data to be transferred is more than one word in length, repeat the procedure from the checking above.
SCL Pin 1 2 3 4 5 6 7 8 9
Write to SBI0DBR SDA Pin D7 D6 D5 D4 D3 D2 D1 D0 ACK Acknowledge signal from a receive INTSBE0 interrupt request
Output of master Output of slave
Figure 3.10.14 Example in which = "000" and = "1" (Transmitter mode)
92CM22-185
2007-02-16
TMP92CM22
When the is "0" (Receiver mode) When the next transmitted data is other than 8 bits, set and read the received data from SBI0DBR to release the SCL line (Data which is read immediately after a slave address is sent is undefined). After the data is read, becomes "1". Serial clock pulse for transferring new 1 word of data is defined SCL and outputs "L" level from SDA pin with acknowledge timing. An INTSBE interrupt request then generates and the becomes "0", Then the TMP92CM22 pulls down the SCL pin to the low level. The TMP92CM22 outputs a clock pulse for 1 word of data transfer and the acknowledge signal each time that received data is read from the SBI0DBR.
SCL line 1 2 3 4 5 6 7 8 9 Read receiving data SDA line D7 D6 D5 D4 D3 D2 D1 D0 ACK New D7
Acknowledge signal to a transmitter
INTSBE0 interrupt request
Output of master Output of slave
Figure 3.10.15 Example of when = "000", = "1" (Receiver mode) In order to terminate the transmission of data to a transmitter, clear to "0" before reading data which is 1 word before the last data to be received. The last data word does not generate a clock pulse as the acknowledge signal. After the data has been transmitted and an interrupt request has been generated, set to "001" and read the data. The TMP92CM22 generates a clock pulse for a 1-bit data transfer. Since the master device is a receiver, the SDA line on the bus remains high. The transmitter receives the high signal as an ACK signal. The receiver indicates to the transmitter that the data transfer is completed. After the one data bit has been received and an interrupt request has been generated, the TMP92CM22 generates a stop condition (See section 3.10.6 (4)) and terminates data transfer.
SCL 9 1 2 3 4 5 6 7 8 1
SDA
D7
D6
D5
D4
D3
D2
D1
D0 Acknowledge signal "H" to transmitter
INTSBE0 interrupt request
After clear to "0", reading receiving data.
After set "001" to , reading receiving data. Output of master Output of slave
Figure 3.10.16 Termination of Data Transfer (Master receiver mode)
92CM22-186
2007-02-16
TMP92CM22
2. If = 0 (Slave mode) In the slave mode the TMP92CM22 operates either in normal slave mode or in slave mode after losing arbitration. In the slave mode, an INTSBE0 interrupt request generate when the TMP92CM22 receives a slave address or a GENERAL CALL from the master device, or when a GENERAL CALL is received and data transfer is completed, or after matching received address. In the master mode, the TMP92CM22 operates in a slave mode if it losing arbitration. An INTSBE0 interrupt request is generated when a word data transfer terminates after losing arbitration. When an INTSBE0 interrupt request is generated the is cleared to "0" and the SCL pin is pulled down to the low level. Either reading/writing from/to the SBI0DBR or setting the to "1" will release the SCL pin after taking tLOW time. Check the SBI0SR, , , and and implements processes according to conditions listed in the next table. Table 3.10.1 Operation in the Slave Mode
1

1

1

0
Conditions
Process
The TMP92CM22 detects arbitration lost Set the number of bits of single word to when transmitting a slave address, and , and write the transmit data to receives a slave address for which the SBI0DBR. value of the direction bit sent from another master is "1". In salve receiver mode, the TMP92CM22 receives a slave address for which the value of the direction bit sent from the master is "1". In salve transmitter mode, transmission of Check the , If is set to "1", set to "1", reset "0" to and data of single word is terminated. release the bus for the receiver no request next data. If was cleared to "0", set bit number of single word to and write the transmit data to SBI0DBR for the receiver requests next data. The TMP92CM22 detects arbitration lost Read the SBI0DBR for setting the when transmitting a slave address, and to "1" (Reading dummy data) or set the receives a slave address or GENERAL to "1". CALL for which the value of the direction bit sent from another master is "0". The TMP92CM22 detects arbitration lost when transmitting a slave address or data, and transfer of word terminates. In slave receiver mode the TMP92CM22 receives a slave address or GENERAL CALL for which the value of the direction bit sent from the master is "0". In slave receiver mode the TMP92CM22 Set bit number of single word to terminates receiving word data. , and read the receiving data from SBI0DBR.
0
1
0
0
0
0
1
1
1/0
0
0
0
1
1/0
0
1/0
92CM22-187
2007-02-16
TMP92CM22
(4) Stop condition generation When SBI0SR = 1, the sequence for generating a stop condition is started by writing "111" to SBI0CR2 and "0" to SBI0CR2. Do not modify the contents of SBI0CR2 until a stop condition has been generated on the bus. When the bus's SCL line has been pulled low by another device, the TMP92CM22 generates a stop condition when the other device has released the SCL line and SDA pin rising.
"1" "1" "0" "1" SCL pin
Stop condition
SDA pin SBI0SR (Reading)
Figure 3.10.17 Stop Condition Generation (Single master)
"1" MST "1" TRX "0" BB "1" PIN Internal SCL SCL pin The case of pulled low by another device
Stop condition
SDA pin

(Read)
Figure 3.10.18 Stop Condition Generation (Multi master)
92CM22-188
2007-02-16
TMP92CM22
(5) Restart Restart is used during data transfer between a master device and a slave device to change the data transfer direction. The following description explains how to restart when this device is in the master mode. Clear the SBI0CR2 to "000" and set the SBI0CR2 to "1" to release the bus. The SDA line remains the high level and the SCL pin is released. Since a stop condition is not generated on the bus, other devices assume the bus to be in a busy state. Check the SBI0SR until it becomes "0" to check that the SCL pin of this device is released. Check the until it becomes 1 to check that the SCL line on a bus is not pulled down to the low level by other devices. After confirming that the bus stays in a free state, generate a start condition with procedure described in 3.10.6 (2). In order to meet setup time when restarting, take at least 4.7 s of waiting time by software from the time of restarting to confirm that the bus is free until the time to generate the start condition.
"0" "0" "0" "1" "1" "1" "1" "1" 4.7 s (Min) SCL (bus) SCL pin SDA pin 9 Start condition
Figure 3.10.19 Timing Diagram when Restarting
92CM22-189
2007-02-16
TMP92CM22 3.10.7 Clocked-synchronous 8-bit SIO Mode Control
The following registers are used to control and monitor the operation status when the serial bus interface (SBI) is being operated in clocked synchronous 8-bit SIO mode. Serial Bus Interface 0 Control Register 1 7
SBI0CR1 (1240H) Bit symbol Read/Write After reset Readmodify-write instruction is prohibited. Function 0 Transfer start 0: Stop 1: Start 0 Continue/ abort transfer 0: Continue transfer 1: Abort transfer SIOS
6
SIOINH W
5
SIOM1
4
SIOM0
3
2
SCK2 W 0
1
SCK1 0
0
SCK0 W 0
0 0 Transfer mode select
00: Transmit mode 01: (Reserved) 10: Transmit/receive mode 11: Receive mode
Serial clock selection and reset monitor
Serial clock selection at write 000 001 010 011 100 101 110 111 n=4 n=5 n=6 n=7 n=8 n=9 n = 10 - 1.25 MHz 625 kHz 313 kHz 156 kHz 78.1 kHz 39.1 kHz 19.5 kHz (External clock : SCK0) System clock: fSYS fSYS = 20 MHz (SCL output to SCK pin) f fscl= SYS [Hz] n 2
Transfer mode selection 00 01 10 11 8-bit transmit mode (Reserved) 8-bit transmit/receive mode 8-bit receive mode
Continue/abort transfer 0 1 Continue transfer Abort transfer (Automatically cleared after transfer aborted)
Indicate transfer start/stop 0 1 Stop Start
Note: Set the transfer mode and the serial clock after setting to "0" and to "1".
Serial Bus Interface 0 Data Buffer Register 7
SBI0DBR Bit symbol (1241H) Read/Write ReadAfter reset modify-write instruction is prohibited. DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Receiver)/W (Transfer) Undefined
Figure 3.10.20 Register for the SIO Mode
92CM22-190
2007-02-16
TMP92CM22
Serial Bus Interface 0 Control Register 2 7
SBI0CR2 (1243H) Bit symbol Read/Write After reset ReadFunction modify-write instruction is prohibited. 0 0 Serial bus interface operation mode selection 00: Port mode 01: SIO mode 2 10: I C bus mode 11: (Reserved)
6
5
4
3
SBIM1
2
SBIM0 W
1
- 0 (Note 2)
0
- 0 (Note 2)
Note 1: Set the SBI0CR1 to "000" before switching to a clocked-synchronous 8-bit SIO mode. Note 2: Please always write "00" to SBICR2<1:0>.
Serial bus interface operation mode selection 00 01 10 11 Port mode (Serial bus interface output disabled) Clocked-synchronous 8-bit SIO mode I C bus mode (Reserved)
2
Serial Bus Interface 0 Status Register 7
SBI0SR (1243H) Bit symbol Read/Write After reset Function 0 Serial transfer operation status monitor
6
5
4
3
SIOF R
2
SEF 0 Shift operation status monitor
1
0
Serial transfer operating status monitor 0 1 Transfer terminated Transfer in progress
Shift operation status monitor 0 1 Shift operation terminated Shift operation in progress
Serial Bus Interface 0 Baud Rate Register 0 7
SBI0BR0 (1244H) Readmodify-write instruction is prohibited. Bit symbol Read/Write After reset Function Note: - W 0
6
- R/W 0
5
4
3
2
1
0
Always write Always "0". write "0". Clocked-syncronous mode cannot operate in IDEL2 mode.
Serial Bus Interface 0 Baud Rate Register 1 7
SBI0BR1 (1245H) Readmodify-write instruction is prohibited. Bit symbol Read/Write After reset Function 0 Internal clock 0: Stop 1: Operate P4EN W 0 Always write "0".
6
-
5
4
3
2
1
0
Baud rate clock control 0 1 Stop Operate
Figure 3.10.21 Register for the SIO Mode
92CM22-191
2007-02-16
TMP92CM22
(1) Serial Clock 1. Clock source SBI0CR1 is used to select the following functions: Internal clock In internal clock mode one of seven frequencies can be selected. The serial clock signal is output to the outside on the SCK pin. When the device is writing (in transmit mode) or reading (in receive mode), data cannot follow the serial clock rate, so an automatic wait function is executed which automatically stops the serial clock and holds the next shift operation until reading or writing has been completed.
Automatic wait
SCK pin output SO pin output Writing transmission data a
1
2
3
7
8
1
2
6
7
8
1
2 c1
3 c2
a0 a1 a2 a5 a6 a7
b0 b1 b4 b5 b6 b7 c 0 b c
Figure 3.10.22 Automatic Wait Function External clock ( = "111") An external clock input via the SCK pin is used as the serial clock. In order to ensure the integrity of shift operations, both the high and low-level serial clock pulse widths shown below must be maintained. The maximum data transfer frequency is 1.25 MHz (when fSYS = 20 MHz).
SCK pin tSCKL tSCKH tSCKL and tSCKH > 8 fSYS
Figure 3.10.23 Maximum Data Transfer Frequency when External Clock Input
92CM22-192
2007-02-16
TMP92CM22
2. Shift edge Data is transmitted on the leading edge of the clock and received on the trailing edge. Leading edge shift Data is shifted on the leading edge of the serial clock (on the falling edge of the SCK pin input/output). Trailing edge shift Data is shifted on the trailing edge of the serial clock (on the rising edge of the SCK pin input/output).
SCK pin SO pin Shift register
Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7 *******7
76543210 *7654321 **765432 ***76543 ****7654 *****765 ******76
(a) Leading shift
SCK pin SI pin Shift register
Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
********
7*******
76****** 765***** 7654**** 76543*** 765432** 7654321* 76543210
(b) Trailing shift
*: Don't care
Figure 3.10.24 Shift Edge
92CM22-193
2007-02-16
TMP92CM22
(2) Transfer modes The SBI0CR1 is used to select a transmit, receive or transmit/receive mode. 1. 8-bit transmit mode Set a control register to a transmit mode and write transmission data to the SBI0DBR. After the transmit data has been written, set the SBI0CR1 to "1" to start data transfer. The transmitted data is transferred from the SBI0DBR to the shift register and output, starting with the least significant bit (LSB), via the SO pin and synchronized with the serial clock. When the transmission data has been transferred to the shift register, the SBI0DBR becomes empty. The INTSBE0 (Buffer empty) interrupt request is generated to request new data. When the internal clock is used, the serial clock will stop and the automatic wait function will be initiated if new data is not loaded to the data buffer register after the specified 8-bit data is transmitted. When new transmission data is written, the automatic wait function is canceled. When the external clock is used, data should be written to the SBI0DBR before new data is shifted. The transfer speed is determined by the maximum delay time between the time when an interrupt request is generated and the time when data is written to the SBI0DBR by the interrupt service program. When the transmit is started, after the SBI0SR goes "1" output from the SO pin holds final bit of the last data until falling edge of the SCK. For stopping data transmission, when the is cleared to "0" by the INTSBE0 interrupt service program or when the is set to "1". When the is cleared to "0", the transmitted mode ends when all data is output. In order to confirm whether data is being transmitted properly by the program, the to be sensed. The SBI0SR is cleared to "0" when transmission has been completed. When the is set to "1", transmitting datat stops. The turns "0". When the external clock is used, it is also necessary to clear the to "0" before new data is shifted; otherwise, dummy data is transmitted and operation ends.
92CM22-194
2007-02-16
TMP92CM22
Clear SCK pin (Output) SO pin INTSBE0 interrupt request SBI0DBR
a b * a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Writing transmission data (a) Internal clock Clear SCK pin (Input) SO pin INTSBE0 interrupt request SBI0DBR
a b * a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Writing transmission data (b) External clock
Figure 3.10.25 Transmission Mode
Example: Program to stop data transmission (when an external clock is used) STEST1 : STEST2 : BIT JR BIT JR LD 2, (SBI0SR) NZ, STEST1 0, (P9) Z, STEST2 (SBI0CR1), 00000111B ; 0 ; If SCK = 0 then loop. ; If = 1 then loop.
92CM22-195
2007-02-16
TMP92CM22
SCK pin SO pin
Bit6 Bit7
tSODH = 3.5/fSYS [s] (Min)
Figure 3.10.26 Transmission Data Hold Time at End Transmit 2. 8-bit receive mode Set the control register to receive mode and set the SBI0CR1 to "1" for switching to receive mode. Data is received into the shift register via the SI pin and synchronized with the serial clock, starting from the least significant bit (LSB). When the 8-bit data is received, the data is transferred from the shift register to the SBI0DBR. The INTSBE0 (Buffer full) interrupt request is generated to request that the received data be read. The data is then read from the SBI0DBR by the interrupt service program. When the internal clock is used, the serial clock will stop and the automatic wait function will be in effect until the received data is read from the SBI0DBR. When the external clock is used, since shift operation is synchronized with an external clock pulse, the received data should be read from the SBI0DBR before the next serial clock pulse is input. If the received data is not read, further data to be received is canceled. The maximum transfer speed when an external clock is used is determined by the delay time between the time when an interrupt request is generated and the time when the received data is read. Receiving of data ends when the is cleared to "0" by the INTSBE0 interrupt service program or when the is set to "1". If is cleared to "0", received data is transferred to the SBI0DBR in complete blocks. The received mode ends when the transfer is completed. In order to confirm whether data is being received properly by the program, the SBI0SR to be sensed. The is cleared to "0" when receiving is completed. When it is confirmed that receiving has been completed, the last data is read. When the is set to "1", data receiving stops. The is cleared to "0" (The received data becomes invalid, therefore no need to read it).
Note:
When the transfer mode is changed, the contents of the SBI0DBR will be lost. If the mode must be changed, conclude data receiving by clearing the to "0", read the last data, then change the mode.
92CM22-196
2007-02-16
TMP92CM22
Clear SCK pin (Output) SI pin INTSEB0 interrupt request SBI0DBR
a b a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Read receive data
Read receive data
Figure 3.10.27 Receiver Mode (Example: Internal clock) 3. 8-bit transmit/receive mode Set a control register to a transmit/receive mode and write data to the SBI0DBR. After the data is written, set the SBI0CR to "1" to start transmitting/receiving. When data is transmitted, the data is output from the SO pin, starting from the least significant bit (LSB) and synchronized with the leading edge of the serial clock signal. When data is received, the data is input via the SI pin on the trailing edge of the serial clock signal. 8-bit data is transferred from the shift register to the SBI0DBR and the INTSBE0 interrupt request is generated. The interrupt service program reads the received data from the data buffer register and writes the data which is to be transmitted. The SBI0DBR is used for both transmitting and receiving. Transmitted data should always be written after received data is read. When the internal clock is used, the automatic wait function will be in effect until the received data is read and the new data is written. When the external clock is used, since the shift operation is synchronized with the external clock, the received data is read and transmitted data is written before a new shift operation is executed. The maximum transfer speed when the external clock is used is determined by the delay time between the time when an interrupt request is generated and the time at which received data is read and transmitted data is written. When the transmit is started, after the SBI0SR goes "1" output from the SO pin holds final bit of the last data until falling edge of the SCK. Transmitting/receiving data ends when the is cleared to "0" by the INTSBE0 interrupt service program or when the SBI0CR1 is set to "1". When the is cleared to "0", received data is transferred to the SBI0DBR in complete blocks. The transmit/receive mode ends when the transfer is completed. In order to confirm whether data is being transmitted/received properly by the program, set the SBI0SR to be sensed. The is cleared to "0" when transmitting/receiving is completed. When the is set to "1", data transmitting/receiving stops. The is then cleared to "0".
Note: When the transfer mode is changed, the contents of the SBI0DBR will be lost. If the mode must be changed, conclude data transmitting/receiving by clearing the to "0", read the last data, and then change the transfer mode.
92CM22-197
2007-02-16
TMP92CM22
Clear SCK pin (Output) SO pin SI pin INTSBE0 interrupt SBI0DBR Interrupt
a c b d * a0 c0 a1 c1 a2 c2 a3 c3 a4 c4 a5 c5 a6 c6 a7 c7 b0 d0 b1 d1 b2 d2 b3 d3 b4 d4 b5 d5 b6 d6 b7 d7
Write transmission data (a)
Write transmission data (b) Read receiving data (c) Read receiving data (d)
Figure 3.10.28 Transmission/Receiving Mode (when an external clock is used)
SCK pin SO pin
Bit6
Bit7 in last transmitted word tSODH = 4/fSYS [s] (Min)
Figure 3.10.29 Transmission Data Hold Time at End of Transmission/Receiving (Transmission/receiving mode)
92CM22-198
2007-02-16
TMP92CM22
3.11 Analog/Digital Converter
The TMP92CM22 incorporates a 10-bit successive approximation-type analog/digital converter (AD converter) with 8-channel analog input. Figure 3.11.1 is a block diagram of the AD converter. The 8-channel analog input pins (AN0 to AN7) are shared with the input-only port G so they can be used as an input port. Note: When IDLE2, IDLE1, or STOP mode is selected, as to reduce the power, with some timings the system may enter a standby mode even though the internal comparator is still enabled. Therefore be sure to check that AD converter operations are halted before a HALT instruction is executed.
Internal data bus Internal data bus Internal data bus
AD mode control register 1 ADMOD1
AD mode control register 0 ADMOD0

Scan Channel selection control circuit Busy End Start Interrupt request INTAD Repeat Interrupt ADTRG
AD converter control circuit AN7 (PG7) Multiplexer AN6 (PG6) AN5 (PG5) AN4 (PG4) AN3/ ADTRG (PG3) AN2 (PG2) AN1 (PG1) AN0 (PG0) Comparater
AD conversion result Sample hold register ADREG0L to ADREG7L ADREG0H to ADREG7H
VREFH VREFL DA converter
Figure 3.11.1 Block Diagram of AD Converter
92CM22-199
2007-02-16
TMP92CM22 3.11.1 Analog/Digital Converter Registers
The AD converter is controlled by the three AD mode control registers: ADMOD0, ADMOD1, and ADMOD2. The eight AD conversion data result registers (ADREG0H/L to ADREG7H/L) store the results of AD conversion. Figure 3.11.2 shows the registers related to the AD converter. AD Mode Control Register 0 7
ADMOD0 (12B8H) Bit symbol Read/Write After reset Function 0 AD conversion end flag EOCF R 0 AD conversion busy flag 0 Always write "0". 0 Always write "0".
6
ADBF
5
-
4
-
3
ITM0 R/W 0 Interrupt specification in conversion channel fixed repeat mode
1: Every fourth conversion
2
REPEAT
1
SCAN
0
ADS
0 0 0 Scan mode AD Repeat specification conversion mode specification 0: Conversion start
0: Single conversion channel 0: Don't care fixed mode 1: Start conversion 1: Conversion Always 0 when channel scan mode read.
0: Conversion 0: Conversion in progress stopped 1: Conversion 1: Conversion complete in progress
1: Repeat conversion 0: Every mode conversion
AD conversion start 0 1 Don't care Start AD conversion.
Note: Always read as 0. AD scan mode setting 0 1 AD conversion channel fixed mode AD conversion channel scan mode
AD repeat mode setting 0 1 AD single conversion mode AD repeat conversion mode
Specify AD conversion interrupt for channel fixed repeat conversion mode Channel fixed repeat conversion mode = "0", = "1" 0 1 Generates interrupt every conversion. Generates interrupt every fourth conversion.
AD conversion busy flag 0 1 AD conversion stopped AD conversion in progress
AD conversion in progress 0 1 Before or during AD conversion AD conversion complete
Figure 3.11.2 Register for AD Converter
92CM22-200
2007-02-16
TMP92CM22
AD Mode Control Register 1 7
ADMOD1 (12B9H) Bit symbol Read/Write After reset Function 0 VREF application control 0: OFF 1: ON 0 IDLE2 0: Stop 1: Operate 0 Always write "0". 0 VREFON
6
I2AD
5
-
4
- R/W
3
- 0
2
ADCH2 0
1
ADCH1 0
0
ADCH0 0
Always write Always "0". write "0".
Analog input channel selection
Analog input channel selection

000 001 010 011 (Note) 100 (Note) 101 (Note) 110 (Note) 111 (Note)
0
Channel fixed AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN0 AN0 AN1
1
Channel scanned
AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN0 AN1 AN2 AN3 AN4 AN0 AN1 AN2 AN3 AN4 AN5 AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7
IDLE2 control 0 1 Stopped In operation
Control of application of reference voltage to AD converter 0 1 OFF ON
AD Mode Control Register 2 7
ADMOD2 (12BAH) Bit symbol Read/Write After reset Function
Before starting conversion (before writing 1 to ADMOD0), set the bit to 1.
6
5
4
3
2
1
0
ADTRGE R/W 0
AD conversion trigger start control 0: Disable 1. Enable
AD conversion start control by external trigger ( ADTRG input ) 0 1 Note: Disabled Enabled
As pin AN3 also functions as the ADTRG input pin, do not set = "011, 100,101,110,111" when using ADTRG with set to "1".
Figure 3.11.3 Register for AD Converter
92CM22-201
2007-02-16
TMP92CM22
AD Conversion Result Register 0 Low 7
ADREG0L (12A0H) Bit symbol Read/Write After reset Function ADR01 R Undefined Stores lower 2 bits of AD conversion result
6
ADR00
5
4
3
2
1
0
ADR0RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 0 High 7
ADREG0H (12A1H) Bit symbol Read/Write After reset Function ADR09
6
ADR08
5
ADR07
4
ADR06 R Undefined
3
ADR05
2
ADR04
1
ADR03
0
ADR02
Stores upper 8 bits AD conversion result.
AD Conversion Result Register 1 Low 7
ADREG1L (12A2H) Bit symbol Read/Write After reset Function ADR11 R Undefined Stores lower 2 bits of AD conversion result
6
ADR10
5
4
3
2
1
0
ADR1RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 1 High 7
ADREG1H (12A3H) Bit symbol Read/Write After reset Function 9 Channel x conversion result ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2 ADREGxL 1 0 8 7 ADR19
6
ADR18
5
ADR17
4
ADR16 R Undefined
3
ADR15
2
ADR14
1
ADR13
0
ADR12
Stores upper 8 bits of AD conversion result. 6 5 4 3 2 1 0
* *
Bits 5 to 1 are always read as 1. Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.4 Register for AD Converter
92CM22-202
2007-02-16
TMP92CM22
AD Conversion Result Register 2 Low 7
ADREG2L (12A4H) Bit symbol Read/Write After reset Function ADR21 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR20
5
4
3
2
1
0
ADR2RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 2 High 7
ADREG2H (12A5H) Bit symbol Read/Write After reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R Undefined
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Stores upper 8 bits of AD conversion result.
AD Conversion Result Register 3 Low 7
ADREG3L (12A6H) Bit symbol Read/Write After reset Function ADR31 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR30
5
4
3
2
1
0
ADR3RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 3 High 7
ADREG3H (12A7H) Bit symbol Read/Write After reset Function 9 Channel x conversion result ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2 ADREGxL 1 0 8 7 6 ADR39
6
ADR38
5
ADR37
4
ADR36 R Undefined
3
ADR35
2
ADR34
1
ADR33
0
ADR32
Stores upper 8 bits of AD conversion result. 5 4 3 2 1 0
* *
Bits 5 to 1 are always read as 1. Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.5 Register for AD Converter
92CM22-203
2007-02-16
TMP92CM22
AD Conversion Result Register 4 Low 7
ADREG4L (12A8H) Bit symbol Read/Write After reset Function ADR41 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR40
5
4
3
2
1
0
ADR4RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 4 High 7
ADREG4H (12A9H) Bit symbol Read/Write After reset Function ADR49
6
ADR48
5
ADR47
4
ADR46 R Undefined
3
ADR45
2
ADR44
1
ADR43
0
ADR42
Stores upper 8 bits of AD conversion result.
AD Conversion Result Register 5 Low 7
ADREG5L (12AAH) Bit symbol Read/Write After reset Function ADR51 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR50
5
4
3
2
1
0
ADR5RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 5 High 7
ADREG5H (12ABH) Bit symbol Read/Write After reset Function 9 Channel x conversion result ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2 ADREGxL 1 0 8 7 ADR59
6
ADR58
5
ADR57
4
ADR56 R Undefined
3
ADR55
2
ADR54
1
ADR53
0
ADR52
Stores upper 8 bits of AD conversion result. 6 5 4 3 2 1 0
* *
Bits 5 to 1 are always read as 1. Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.6 Register for AD Converter
92CM22-204
2007-02-16
TMP92CM22
AD Conversion Result Register 6 Low 7
ADREG6L (12ACH) Bit symbol Read/Write After reset Function ADR61 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR60
5
4
3
2
1
0
ADR6RF R 0
AD conversion data storage flag 1:Conversion result stored
AD Conversion Result Register 6 High 7
ADREG6H (12ADH) Bit symbol Read/Write After reset Function ADR69
6
ADR68
5
ADR67
4
ADR66 R Undefined
3
ADR65
2
ADR64
1
ADR63
0
ADR62
Stores upper 8 bits of AD conversion result.
AD Conversion Result Register 7 Low 7
ADREG7L (12AEH) Bit symbol Read/Write After reset Function ADR71 R Undefined Stores lower 2 bits of AD conversion result.
6
ADR70
5
4
3
2
1
0
ADR7RF R 0
AD conversion data storage flag 1: Conversion result stored
AD Conversion Result Register 7 High 7
ADREG7H (12AFH) Bit symbol Read/Write After reset Function 9 Channel x conversion result ADREGxL 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 8 7 ADR79
6
ADR78
5
ADR77
4
ADR76 R Undefined
3
ADR75
2
ADR74
1
ADR73
0
ADR72
Stores upper 8 bits of AD conversion result. 6 5 4 3 2 1 0
* *
Bits 5 to 1 are always read as 1. Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.7 Register for AD Converter
92CM22-205
2007-02-16
TMP92CM22 3.11.2 Description of Operation
(1) Analog reference voltage A high-level analog reference voltage is applied to the VREFH pin; a low-level analog reference voltage is applied to the VREFL pin. To perform AD conversion, the reference voltage, the difference between VREFH and VREFL, is divided by 1024 using string resistance. The result of the division is then compared with the analog input voltage. To turn off the switch between VREFH and VREFL, program a 0 to ADMOD1 in AD mode control register 1. To start AD conversion in the OFF state, first write a 1 to ADMOD1, wait 3 s until the internal reference voltage stabilizes (This is not related to fSYS), then set ADMOD0 to 1. (2) Analog input channel selection The analog input channel selection varies depends on the operation mode of the AD converter. * In analog input channel fixed mode (ADMOD0 = 0) Setting ADMOD1 selects one of the input pins AN0 to AN7 as the input channel. * In analog input channel scan mode (ADMOD0 = 1) Setting ADMOD1 selects one of the eight scan modes. Table 3.11.1 illustrates analog input channel selection in each operation mode. On a reset, ADMOD0 is set to "0" and ADMOD1 is initialized to "000". Thus pin AN0 is selected as the fixed input channel. Pins not used as analog input channels can be used as standard input port pins. Table 3.11.1 Analog Input Channel Selection
000 001 010 011 100 101 110 111
Channel fixed = "0"
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN0
Channel scan = "1"
AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN0 AN1 AN2 AN3 AN4 AN0 AN1 AN2 AN3 AN4 AN5 AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7
92CM22-206
2007-02-16
TMP92CM22
(3) Starting AD conversion To start AD conversion, program "1" to ADMOD0 in AD mode control register 0, or ADMOD1 in AD mode control register 1 and input falling edge on ADTRG pin. When AD conversion starts, the AD conversion busy flag ADMOD0 will be set to "1", indicating that AD conversion is in progress. (4) AD conversion modes and the AD conversion end interrupt The four AD conversion modes are: * Channel fixed single conversion mode * Channel scan single conversion mode * Channel fixed repeat conversion mode * Channel scan repeat conversion mode The ADMOD0 and ADMOD0 settings in AD mode control register 0 determine the AD mode setting. Completion of AD conversion triggers an INTAD AD conversion end interrupt request. Also, ADMOD0 will be set to 1 to indicate that AD conversion has been completed. 1. Channel fixed single conversion mode Setting ADMOD0 and ADMOD0 to "00" selects conversion channel fixed single conversion mode. In this mode data on one specified channel is converted once only. When the conversion has been completed, the ADMOD0 flag is set to 1, ADMOD0 is cleared to "0", and an INTAD interrupt request is generated. 2. Channel scan single conversion mode Setting ADMOD0 and ADMOD0 to "01" selects conversion channel scan single conversion mode. In this mode data on the specified scan channels is converted once only. When scan conversion has been completed, ADMOD0 is set to "1", ADMOD0 is cleared to "0", and an INTAD interrupt request is generated.
92CM22-207
2007-02-16
TMP92CM22
3. Channel fixed repeat conversion mode Setting ADMOD0 and ADMOD0 to "10" selects conversion channel fixed repeat conversion mode. In this mode data on one specified channel is converted repeatedly. When conversion has been completed, ADMOD0 is set to "1" and ADMOD0 is not cleared to "0" but held at "1". INTAD interrupt request generation timing is determined by the setting of ADMOD0. Clearing to "0" generates an interrupt request every time an AD conversion is completed. Setting to "1" generates an interrupt request on completion of every fourth conversion. 4. Channel scan repeat conversion mode Setting ADMOD0 and ADMOD0 to "11" selects conversion channel scan repeat conversion mode. In this mode data on the specified scan channels is converted repeatedly. When each scan conversion has been completed, ADMOD0 is set to "1" and an INTAD interrupt request is generated. ADMOD0 is not cleared to "0" but held at "1". To stop conversion in a repeat conversion mode (e.g., in cases c and d), program a "0" to ADMOD0. After the current conversion has been completed, the repeat conversion mode terminates and ADMOD0 is cleared to "0". Switching to a halt state (IDLE2 mode with ADMOD1 cleared to "0", IDLE1 mode or STOP mode) immediately stops operation of the AD converter even when AD conversion is still in progress. In repeat conversion modes (e.g., in cases c and d), when the halt is released, conversion restarts from the beginning. In single conversion modes (e.g., in cases a and b), conversion does not restart when the halt is released (The converter remains stopped). Table 3.11.2 shows the relationship between the AD conversion modes and interrupt requests.
Table 3.11.2 Relationship between the AD Conversion Modes and Interrupt Requests AD Mode
Channel fixed single conversion mode Channel scan single conversion mode Channel fixed repeat conversion mode Channel scan repeat conversion mode X: Don't care
Interrupt Request Generation
After completion of conversion After completion of scan conversion Every conversion Every forth conversion After completion of every scan conversion
ADMOD0
X X 0 1 X 0 0 1 1 0 1 0 1
92CM22-208
2007-02-16
TMP92CM22
(5) AD conversion time 84 states (8.4 s at fSYS = 20 MHz) are required for the AD conversion of one channel. (6) Storing and reading the results of AD conversion The AD conversion data upper and lower registers (ADREG0H/L to ADREG7H/L) store the results of AD conversion. (ADREG0H/L to ADREG7H/L are read-only registers.) In channel fixed repeat conversion mode, the conversion results are stored successively in registers ADREG0H/L to ADREG3H/L. In other modes the AN0, AN1, AN2, AN3, AN4 AN5, AN6, AN7 conversion results are stored in ADREG0H/L, ADREG1H/L, ADREG2H/L, ADREG3H/L, ADREG4H/L, ADREG5H/L, ADREG6H/L, ADREG7H/L respectively. Table 3.11.3 shows the correspondence between the analog input channels and the registers which are used to hold the results of AD conversion. Table 3.11.3 Correspondence between Analog Input Channel and AD Conversion Result Register Analog Input Channel (Port G)
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7
AD Conversion Result Register Conversion Modes Other than at Right
ADREG0H/L ADREG1H/L ADREG2H/L ADREG3H/L ADREG4H/L ADREG5H/L ADREG6H/L ADREG7H/L ADREG0H/L ADREG1H/L ADREG2H/L ADREG3H/L
Channel Fixed Repeat Conversion Mode (ADMOD0= "1")
, bit0 of the AD conversion data lower register, is used as the AD conversion data storage flag. The storage flag indicates whether the AD conversion result register has been read or not. When a conversion result is stored in the AD conversion result register, the flag is set to "1". When either of the AD conversion result registers (ADREGxH or ADREGxL) is read, the flag is cleared to "0". Reading the AD conversion result also clears the AD conversion end flag ADMOD0 to "0".
92CM22-209
2007-02-16
TMP92CM22
Example: 1. Convert the analog input voltage on the AN3 pin and write the result, to memory address 0800H using the AD interrupt (INTAD) processing routine.
Setting of main routine 76543210 INTE0AD X 1 0 0 - - - - ADMOD1 1 1 0 0 0 0 1 1 ADMOD0 X X 0 0 0 0 0 1 Interrupt routine processing example WA WA (0800H) ADREG3 >>6 WA Read value of ADREG3L, ADREG3H to general purpose register WA (16 bits). Shift contents read into WA six times to right and zero-fill upper bits. Write contents of WA to memory address 0800H. Enable INTAD and set it to interrupt level 4. Set pin AN3 to the analog input channel. Start conversion in channel fixed single conversion mode.
2.
Converts repeatedly the analog input voltages on the three pins AN0, AN1, and AN2, using channel scan repeat conversion mode.
INTE0AD X 0 0 0 - - - - ADMOD1 1 1 0 0 0 0 1 0 ADMOD0 X X 0 0 0 1 1 1 X : Don't care, - : No change Disable INTAD. Set pins AN0 to AN2 to be the analog input channels. Start conversion in channel scan repeat conversion mode.
92CM22-210
2007-02-16
TMP92CM22
3.12 Watchdog Timer (Runaway detection timer)
The TMP92CM22 contains a watchdog timer of runaway detecting. The watchdog timer (WDT) is used to return the CPU to the normal state when it detects that the CPU has started to malfunction (Runaway) due to causes such as noise. When the watchdog timer detects a malfunction, it generates a non-maskable interrupt INTWD to notify the CPU of the malfunction. Connecting the watchdog timer output to the reset pin internally forces a reset. (The level of external RESET pin is not changed.)
3.12.1
Configuration
Figure 3.12.1 is a block diagram of the watchdog timer (WDT).
WDMOD
RESET pin
Reset control
Internal reset
Interrupt request INTWD WDMOD 2 fIO
15
Selector 2
17
2
19
2
21
Binary counter (22-Stage) Reset
Q R S
Internal reset Write 4EH Write B1H WDMOD
Watchdog timer register control register WDCR
Internal data bus
Figure 3.12.1 Block Diagram of Watchdog Timer
Note: Care must be exercised in the overall design of the apparatus since the watchdog timer may fail to function correctly due to external noise, etc.
92CM22-211
2007-02-16
TMP92CM22 3.12.2 Operation
The watchdog timer generates an INTWD interrupt when the detection time set in the WDMOD has elapsed. The watchdog timer must be cleared "0" in software before an INTWD interrupt will be generated. If the CPU malfunctions (e.g., if runaway occurs) due to causes such as noise, but does not execute the instruction used to clear the binary counter, the binary counter will overflow and an INTWD interrupt will be generated. The CPU will detect malfunction (runaway) due to the INTWD interrupt and in this case it is possible to return to the CPU to normal operation by means of an anti-malfunction program. The watchdog timer begins operating immediately on release of the watchdog timer reset. The watchdog timer is halted in IDLE1 or STOP mode. The watchdog timer counter continues counting during bus release (when BUSAK goes low). When the device is in IDLE2 mode, the operation of WDT depends on the WDMOD setting. Ensure that WDMOD is set before the device enters IDLE2 mode. The watchdog timer consists of a 22-stage binary counter which uses the clock (2/fIO) as the input clock. The binary counter can output 215/fIO, 217/fIO, 219/fIO and 221/fIO.
WDT counter WDT interrupt Write clear code WDT clear (Software)
n
Overflow
0
Figure 3.12.2 Normal Mode The runaway detection result can also be connected to the reset pin internally. In this case, the reset time will be between 22 and 29 system clocks (35.2 to 46.4 s at fOSCH = 40 MHz) as shown inFigure 3.12.3. After a reset, the fSYS clock is fFPH/2, where fFPH is generated by dividing the high-speed oscillator clock (fOSCH) by sixteen through the clock gear function
Overflow WDT counter WDT interrupt Internal reset 22 to 29 clocks (35.2 to 46.4 s at fOSCH = 40 MHz) n
Figure 3.12.3 Reset Mode
92CM22-212
2007-02-16
TMP92CM22 3.12.3 Control Registers
The watchdog timer (WDT) is controlled by two control registers WDMOD and WDCR. (1) Watchdog timer mode register (WDMOD) 1. Setting the detection time for the watchdog timer in This 2-bit register is used for setting the watchdog timer interrupt time used when detecting runaway. On a reset this register is initialized to WDMOD = 00. The detection time for WDT is 215/fSYS [s]. (The number of system clocks is approximately 65, 536.) 2. Watchdog timer enable/disable control register At reset, the WDMOD is initialized to 1, enabling the watchdog timer. To disable the watchdog timer, it is necessary to set this bit to 0 and to write the disable code (B1H) to the watchdog timer control register (WDCR). This makes it difficult for the watchdog timer to be disabled by runaway. However, it is possible to return the watchdog timer from the disabled state to the enabled state merely by setting to 1. 3. Watchdog timer out reset connection This register is used to connect the output of the watchdog timer with the RESET terminal internally. Since WDMOD is initialized to 0 at reset, a reset by the watchdog timer will not be performed. (2) Watchdog timer control register (WDCR) This register is used to disable and clear the binary counter for the watchdog timer. * Disable control The watchdog timer can be disabled by clearing WDMOD to 0 and then writing the disable code (B1H) to the WDCR register.
WDCR WDMOD WDCR 0 0 1 1 - 0 0 - 1 0 - 1 1 0 0 1 - 0 1 - 0 0 0 1 Write the clear code (4EH). Clear WDMOD to 0. Write the disable code (B1H).
*
Enable control Set WDMOD to 1.
*
Watchdog timer clear control To clear the binary counter and cause counting to resume, write the clear code (4EH) to the WDCR register.
WDCR 0 1 0 0 1 1 1 0 Write the clear code (4EH).
Note1: If the disable control, set the disable code (B1H) to WDCR after weirint the clear code (4EH) once. (Please refer to setting example.) Note2: If the Watchdog timer setting, change setting after setting to disable condition once.
92CM22-213
2007-02-16
TMP92CM22
7
WDMOD (1300H) Bit symbol Read/Write After reset Function 1 1: Enable WDTE
6
WDTP1 R/W 0 00: 2 /fIO 01: 2 /fIO 10: 2 /fIO 11: 2 /fIO
21 19 17 15
5
WDTP0 0
4
3
- 0 Always write "0"
2
I2WDT R/W 0 IDLE2 0: Stop 1: Operate
1
RESCR 0 1: Internally connects WDT out to the reset pin
0
- 0 Always write "0"
WDT control Select detecting time
Watchdog timer out control 0 1 - Connects WDT out to a reset
IDLE2 control 0 1 Stop Operation
Watchdog timer detection time 00 01 10 11 2 /fIO (Approximately 3.28 ms at fOSCH = 40 MHz)
15 17 19 21
2 /fIO (Approximately 1.31 ms at fOSCH = 40 MHz) 2 /fIO(Approximately 52.4 ms at fOSCH = 40 MHz) 2 /fIO (Approximately 210 ms at fOSCH = 40 MHz)
Watchdog timer enable/disable control 0 1 Disabled Enabled
Figure 3.12.4 Watchdog Timer Mode Register
7
WDCR (1302H) Bit symbol Read/Write
6
5
4
- W -
3
2
1
0
Read After reset -modify Function -write instruction is prohibited
B1H: WDT disable code 4EH: WDT clear code
WDT disable/clear control B1H 4EH Others Disable code Clear code Don't care
Figure 3.12.5 Watchdog Timer Control Register
92CM22-214
2007-02-16
TMP92CM22
4.
4.1
Electrical Characteristics
Absolute Maximum Ratings
Parameter
Power supply voltage Input voltage Output current (1 pin) Output current (1 pin) Output current (Total) Output current (Total) Power dissipation (Ta = 85C) Soldering temperature (10 s) Storage temperature Operation temperature
Symbol
Vcc VIN IOL IOH IOL IOH PD TSOLDER TSTG TOPR
Rating
-0.5 to 4.0 -0.5 to Vcc + 0.5 2 -2 80 -80 600 260 -65 to 150 -40 to 85
Unit
V
mA
mW C
Note: The absolute maximum ratings are rated values that must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any absolute maximum rating is exceeded, the device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. Thus, when designing products that include this device, ensure that no absolute maximum rating value will ever be exceeded.
Solderability of lead-free products
Test parameter Solderability (1) Use of Sn-37Pb solder Bath Solder bath temperature =230C, Dipping time = 5 seconds The number of times = one, Use of R-type flux (2) Use of Sn-3.0Ag-0.5Cu solder bath Solder bath temperature =245C, Dipping time = 5 seconds The number of times = one, Use of R-type flux (use of lead-free) Pass: solderability rate until forming 95% Test condition Note
92CM22-215
2007-02-16
TMP92CM22
DC Characteristics (1/2)
Vcc = 3.3 0.3 V/fc = 4 to 40 MHz/Ta = -40 to 85C
Parameter
Power supply voltage
(DVCC = AVCC) (DVSS = AVSS = 0 V)
Symbol
VCC
Condition
fc = 4 to 40 MHz (fSYS = 125 kHz to 20 MHz)
Min
3.0
Typ.
Max
3.6
Unit
V
Input low voltage
P00 to P07 (D0 to D7) P10 to P17 (D8 to D15)
VIL0 0.6 VIL1
Input low voltage
P40 to P47 P50 to P57 P60 to P67 P76 PD2, PD3 PF0, PF3, PF6, PF7 PG0 to PG7
0.3 x VCC
Input low voltage
P90 to P92 PA0 to PA2, PA7 PC0, PC1, PC3, PC5, PC6 PD0, PD1 PF1, PF2, PF4, PF5 RESET, NMI
VIL2
-0.3
V
0.25 x VCC
Input low voltage
AM0, AM1
VIL3 VIL4 VIH0 2.0 VIH1
0.3 0.2 x VCC
Input low voltage
X1
Input high voltage
P00 to P07 (D0 to D7) P10 to P17 (D8 to D15)
Input high voltage
P40 to P47 P50 to P57 P60 to P67 P76 PD2, PD3 PF0, PF3, PF6, PF7 PG0 to PG7
0.7 x VCC
Input high voltage
P90 to P92 PA0 to PA2, PA7 PC0, PC1, PC3, PC5, PC6 PD0, PD1 PF1, PF2, PF4, PF5 RESET, NMI
VIH2
VCC + 0.3
V
0.75 x VCC
Input high voltage
AM0, AM1
VIH3 VIH4
VCC - 0.3 0.8 x VCC
Input high voltage
X1
92CM22-216
2007-02-16
TMP92CM22
DC Characteristics (2/2)
Vcc = 3.3 0.3 V/fc = 4 to 40 MHz/Ta = -40 to 85C
Parameter
Output low voltage Output high voltage Input leakage current Output leakage current Power down voltage (at STOP, RAM backup)
RESET pull-up resistor Programmable pull-up resistor
Symbol
VOL VOH ILI ILO VSTOP RRST RKH CIO fc = 1 MHz P90 to P92
Condition
IOL = 1.6 mA IOH = -400 A 0.0 Vin VCC 0.2 Vin VCC - 0.2 VIL2 = 0.2 x Vcc, VIH2 = 0.8 x Vcc
Min
2.4
Typ.
Max
0.45
Unit
V A V
0.02 0.05 1.8 100
5 10 3.6
400 10
k pF
Pin capacitance
PA0 to PA2, PA7 Schmitt width VTH PC0, PC1, PC3, PC5, PC6 PD0, PD1 PF1, PF2, PF4, PF5
RESET , NMI
0.4
1.0
V
NORMAL IDLE2 mode IDLE1 mode STOP
ICC ICCIDLE2 ICCIDLE1 ICCSTOP
VCC = 3.6 V, X1 = 40 MHz (Internal 20 MHz)
30 17 3
42 25 5 100 A mA
Vcc = 3.6 V
1
92CM22-217
2007-02-16
TMP92CM22
4.2
AC Characteristics
Basis Bus Cycle
Vcc = 3.3 0.3 V/fc = 4 to 40 MHz/Ta = -40 to 85C
4.2.1
Read cycle fSYS = fSYS = 20 MHz 125 kHz Unit (fc = 40 MHz) (fc = 4 MHz)
25 50 10 10 2.0T - 30 3.0T - 30 1.5T - 30 70 120 45 250 8000 3985 3985 15970 23970 11970 ns ns ns ns ns ns ns
No.
1 2 3 4 5-1 5-2 6-1 6-2
Parameter
OSC period (X1/X2) System clock period (= T) CLKOUT low width CLKOUT high width A0 to A23 valid D0 to D15 input at 0 waits A0 to A23 valid D0 to D15 input at 1 wait
RD fall
Symbol
tOSC tCYC tCL tCH tAD tAD3 tRD
Min
25 50 0.5T - 15 0.5T - 15
Max
250 8000
D0 to D15 input at 0 waits
RD fall D0 to D15 input at 1 wait
RD low width RD low width
tRD3 tRR tRR3 tAR tRK tHA tHR tTK tKT 1.5T - 20 2.5T - 20 0.5T - 15 0.5T - 20 0 0 15 5
2.5T - 30
95 55 105 10 5 0 0 15 5
19970 11980 19980 3985 3980 0 0 15 5
ns ns ns ns ns ns ns ns ns
7-1 7-2 8 9 10 11 12 13
at 0 waits at 1 wait
RD fall
A0 to A23 valid
RD fall
CLKOUT fall D0 to D15 hold D0 to D15 hold
A0 to A23 valid
RD rise WAIT setup time WAIT hold time
Write cycle
Vcc = 3.3 0.3 V/fc = 4 to 40 MHz/Ta = -40 to 85C
No.
Parameter
Symbol
tOSC tCYC tCL tCH tDW tDW3 tWW tWW3 tAW tWK tWA tWD tTK tKT tRDO
Min
25 50 0.5T - 15 0.5T - 15 1.25T - 35 2.25T - 35 1.25T - 30 2.25T - 30 0.5T - 15 0.5T - 20 0.25T - 5 0.25T - 3 15 5 0.5T - 5
Max
250 8000
fSYS = fSYS = 20 MHz 125 kHz Unit (fc = 40 MHz) (fc = 4 MHz)
25 50 10 10 28 78 33 83 10 5 8 10 15 5 20 250 8000 3985 3985 9965 17965 9970 17970 3985 3980 1995 1997 15 5 3995 ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
1 OSC period (X1/X2) 2 System clock period (= T) 3 CLKOUT low width 4 CLKOUT high width 5-1 D0 to D15 valid WRxx rise at 0 waits 5-2 D0 to D15 valid WRxx rise at 1 wait 6-1 6-2 8 9 10 11 12
WRxx low width
at 0 waits at 1 wait
WRxx low width
7 A0 to A23 valid WR fall
WRxx fall
CLKOUT fall
WRxx rise A0 to A23 hold
WRxx rise D0 to D15 hold
WAIT setup time
WAIT hold time
13 RD rise D0 to D15 output AC condition
* Output : High = 0.7Vcc, Low = 0.3Vcc, CL = 50 pF
*
Input :
High = 0.9Vcc, Low = 0.1Vcc
92CM22-218
2007-02-16
TMP92CM22
(1) Read cycle (0 waits, fc = fOSCH, fFPH = fc/1)
tOSC X1 tCYC tCL CLKOUT tCH
tTK
WAIT
tKT
A0 to A23
tAD
CSx
tHA R/ W tAR
RD
tRK tHR tRR tRD
D0 to D31
Data input
Note:
The phase relation between X1 input signal and the other signals is unsettled. The timing chart above is an example.
92CM22-219
2007-02-16
TMP92CM22
(2) Write cycle (0 waits, fc = fOSCH, fFPH = fc/1)
tOSC X1 tCYC tCL CLKOUT tTK
WAIT
tCH
tKT
A0 to A23
CSx
R/ W tAW
WRxx
tWK
tWA
tWW tDW D0 to D31
RD
tWD
tRDO
Data output
Note:
The phase relation between X1 input signal and the other signals is unsettled. The timing chart above is an example.
92CM22-220
2007-02-16
TMP92CM22
(3) Read cycle (1 wait)
CLKOUT
WAIT
A0 to A23 tAD3
CSx
R/ W
RD
tRR3 tRD3 Data input
D0 to D31
(4) Write cycle (1 wait)
CLKOUT
WAIT
A0 to A23
CSx
R/ W
WRxx
tWW3 tDW3 D0 to D31
RD
tRD0
Data output
92CM22-221
2007-02-16
TMP92CM22 4.2.2 Page ROM Read Cycle
(1) 3-2-2-2 mode
Vcc = 3.3 0.3 V/fc = 4 to 40 MHz/Ta = -40 to 85C
No. Parameter
1 2 3 4 5 6 System clock period ( = T) A0, A1 D0 to D31 input A2 to A23 D0 to D31 input RD falling D0 to D31 input A0 to A23 invalid D0 to D31 hold
RD rising D0 to D31 hold
Symbol
tCYC tAD2 tAD3 tRD3 tHA tHR
Min
50
Max
8000 2.0T - 50 3.0T - 50 2.5T - 45
fSYS = fSYS = Unit 20 MHz 125 kHz (fc = 40 MHz) (fc = 4 MHz)
50 50 100 80 0 0 8000 15950 23950 19955 0 0 ns ns ns ns ns ns
0 0
AC condition
* Output: High = 0.7 Vcc, Low = 0.3 Vcc, CL = 50 pF * Input:
High = 0.9 Vcc, Low = 0.1 Vcc
(2) Page ROM read cycle (3-2-2-2 mode)
CLKOUT tCYC A0 to A23
CS2
+0
+1
+2
+3
tAD3
RD
tAD2
tAD2
tAD2
tHA
tAD3 D0 to D31
Data input
tHA
Data input
tHA
Data input
tHA
Data input
tHR
92CM22-222
2007-02-16
TMP92CM22
4.3
AD Conversion Characteristics
Parameter
Analog reference voltage (+) Analog reference voltage (-) AD converter power supply voltage AD converter power supply ground Analog input voltage Analog current for analog reference voltage = 1 Analog current for analog reference voltage = 0 Total error (Include quantize error of 0.5 LSB ) ET
Symbol
VREFH VREFL AVCC AVSS AVIN IREF
Min
VCC - 0.2 VSS VCC VSS VREFL
Typ.
VCC VSS VCC VSS
Max
VCC VSS + 0.2 VCC VSS VREFH
Unit
V
1.0
1.2
mA
0.02
1.0
5.0
4.0
UA LSB
4.4
Event Counter (TA0IN, TB1IN0, and TB1IN1)
fSYS = 20 MHz (fc = 40 MHz) MIN
500 240 240
Parameter
Symbol MIN
Variable MAX
fSYS = 125 kHz (fc = 4 MHz) MIN
64100 32040 32040
Unit
MAX
MAX
ns ns ns
Clock cycle Low-level clock width High-level clock width
TVCK TVCKL TVCKH
8X + 100 4X + 40 4X + 40
Note:
Symbol "x" in the above table means the period of clock "fSYS", it's same period of the system clock "fSYS" for CPU core. The period of fSYS depends on the clock gear setting or changing high-speed oscillator/low-speed oscillator and so on.
92CM22-223
2007-02-16
TMP92CM22
4.5
Serial Channel Timing (I/O interface mode)
Note: Symbol "X" in the following table means the period of clock "fSYS", it's same period of the system clock "fSYS" for CPU core. The period of fSYS depends on the clock gear setting or changing high-speed oscillator/low-speed oscillator and so on.
(1)
SCLK input mode Variable Min Max fSYS = 20 MHz (fc = 40 MHz) Min
0.8 90 500 160 tSCY - 0 0 0 800 0
Parameter
Symbol
fSYS = 125 kHz (fc = 4 MHz) Min
128 31890 80000 24010 128000
Unit
Max
Max
s
SCLK period Output data SCLK rising/falling* SCLK rising/falling* SCLK rising/falling* SCLK rising/falling
Output data hold Input data hold Valid data input
tSCY tOSS tOHS tHSR tSRD tRDS
16X tSCY/2 - 4X - 110 tSCY/2 + 2X + 0 3X + 10
ns ns ns ns ns
Valid data input SCLK rising/falling
*) SCLK rinsing/falling edge:
The rising edge is used in SCLK rising mode. The falling edge is used in SCLK falling mode.
Note:
Value of fSYS = 20 MHz, 125 kHz is value if tSCY = 16X.
(2) SCLK output mode Variable Min
SCLK period Output data SCLK rising/falling* SCLK rising/falling* SCLK rising/falling* SCLK rising/falling Valid data input
Output data hold Input data hold Valid data input
Parameter
Symbol
fSYS = 20 MHz (fc = 40 MHz) Max
8192X
fSYS = 125 kHz (fc = 4 MHz) Min
128 3960 3960 0
Unit
Min
0.8 360 360 0
Max
409.6
Max
65536
s
tSCY tOSS tOHS tHSR tSRD
16X tSCY/2 - 40 tSCY/2 - 40 0
ns ns ns 65528 8180 ns ns
tSCY - 1X - 180 1X + 180
409.4 230
SCLK rising/falling tRDS
92CM22-224
2007-02-16
TMP92CM22
tSCY SCLK Output mode/ input rising mode SCLK (Input falling mode) Output data TXD Input data RXD
tOSS 0
tOHS 1 tSRD tRDS 1 Valid tHSR 2 Valid 3 Valid 2 3
0 Valid
4.6
Interrupt, Capture
Note: Symbol "X" in the following table means the period of clock "fSYS", it's same period of the system clock "fSYS" for CPU core. The period of fSYS depends on the clock gear setting or changing high-speed oscillator/low-speed oscillator and so on.
(1) NMI and INT0 to INT3 interrupts Variable Min
INT0 to INT3 low width INT0 to INT3 high width TINTAL TINTAH 4X + 40 4X + 40
Parameter
Symbol
fSYS = 20 MHz (fc = 40 MHz) Min
240 240
fSYS = 125 kHz (fc = 4 MHz) Min
32040 32040
Unit
Max
Max
Max
ns
(2)
INT4 to INT5 interrupts tINTBL
(INT4 to INT5 Low Level Pulse Width)
tINTBH
(INT4 to INT5 High Level Pulse Width)
Variable Min
8X + 100
fSYS = 20 MHz (fc = 40 MHz) Min
500
Variable Min
8X + 100
fSYS = 20 MHz (fc = 40 MHz) Min
500
Unit
ns
92CM22-225
2007-02-16
TMP92CM22
4.7
Recommended Oscillation Circuit
TMP92CM22 is evaluated by below oscillator vender. When selecting external parts, make use of this information. Note 1: Total loads value of oscillation is sum of external (or internal) loads (C1 and C2) and floating loads of actual assemble board. There is a possibility of miss operating using C1 and C2 values in below table. When designing board, it should design minimum length pattern around oscillator. And we recommend that oscillator evaluation try on your actual using board. Note 2: When use function of reduced drivability for high-frequency oscillator, must be used at fOSCH = 4 to 10 MHz.
(1) Example of oscillation connection circuit
X1 X2 Rd
C1
C2
Figure 4.7.1 High-frequency Oscillator
92CM22-226
2007-02-16
TMP92CM22
(2) TMP92CM22 recommended ceramic oscillator: Murata Manufacturing Co., Ltd. Following table shows circuit parameter recommended.
IC Name
Oscillation Frequency [MHz]
Type
Item of Oscillator (Old number)
CSTCR4M00G55-R0 (New and old is same product No.) CSTLS4M00G56-B0 (CSTS0400MG06) CSTCR6M00G55-R0 (New and old is same product No.) CSTLS6M00G56-B0 (CSTS0600MG06) CSTCE10M0G55-R0 (New and old is same product No.) CSTLS10M0G53-B0 (CSTS1000MG03) CSTCG20M0V51-R0 (New and old is same product No.) CSCTW20M0X51-R0 (CSTCW2000MX01) CSTCW36M0X51-R0 (CSTCW3600MX01) CSACW40M0X51-R0) (CSACW4000MX01)
Parameter of Elements C1 [pF]
(39)
Running Condition Voltage of Power [V] Tc [C]
C2 [pF]
(39)
Rf []
Open
Rd []
0
SMD 4.000 Lead
(47) (39)
(47) (39)
Open Open
0 0
SMD 6.000 Lead
(47) (33)
(47) (10)
Open Open
0 0 3.0 to 3.6
-40 to +85
TMP92CM22FG
SMD 10.000 Lead SMD (New) SMD 36.000 40.000 SMD 2-pin SMD
(15) (6)
(15) (15)
Open Open
0 0
20.000
(5) (6) 3
(5) (6) 3
Open 15 k 15 k
0 0 0
Note 1 : "()" of C1 and C2 are built in condenser type. Note 2 : The product numbers and specifications of the resonators by Murata Manufacturing Co., Ltd. are subject to change. For up-to-date information, please refer to the following URL: http://www.murata.co.jp
92CM22-227
2007-02-16
TMP92CM22
5.
Table of Special Function Registers (SFRs)
The SFRs include the I/O ports and peripheral control registers allocated to the 8 Kbytes address space from 000000H to 001FFFH. (1) I/O port (2) Interrupt controller (3) DMA controller (4) Memory controller (5) Clock gear/PLL (6) 8-bit timer (7) 16-bit timer (8) UART/SIO (9) I2C bus/SIO (10) 10-bit ADC (11) WDT
Table layout Symbol Name Address 7 6 1 0 Bit symbol Read/Write Initial value after reset Remarks
Note:
"Prohibit RMW" in the table means that you cannot use RMW instructions on these register. Example: When setting bit0 only of the register PxCR, the instruction "SET 0, (PxCR)" cannot be used. The LD (Transfer) instruction must be used to write all eight bits.
Read/Write
R/W: Both read and write are possible. R: Only read is possible. W: Only write is possible. W*: Both read and write are possible (when this bit is read as 1). Prohibit RMW: Read-modify-write instructions are prohibited. (The EX, ADD, ADC, BUS, SBC, INC, DEC, AND, OR, XOR, STCF, RES, SET, CHG, TSET, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, and RRD instruction are read-modify-write instructions.) R/W: Read-modify-write is prohibited when controlling the pull-up resistor.
92CM22-228
2007-02-16
TMP92CM22
Table 5.1 I/O Register Address Map [1] I/O port Address
0000H 1H 2H 3H 4H P1 5H 6H P1CR 7H P1FC 8H 9H AH BH CH DH EH FH
Name
Address
0010H P4 1H
Name
Address
0020H P8 1H 2H
Name
Address
0030H PC 1H
Name
2H P4CR 3H P4FC 4H P5 5H 6H P5CR 7H P5FC 8H P6 9H AH P6CR BH P6FC CH P7 DH EH P7CR FH P7FC
2H PCCR 3H PCFC 4H PD 5H 6H PDCR 7H PDFC 8H 9H AH BH CH PF DH EH PFCR FH PFFC
3H P8FC 4H P9 5H P9ODE 6H P9CRP 7H 9FC 8H PA 9H AH BH CH DH EH FH
Address
0040H PG 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Name
Note: Do not access un-named addresses.
92CM22-229
2007-02-16
TMP92CM22
[2] Interrupt controller Address
Name
[3] Address
Name
DMA controller
Name
0100H DMA0V 1H DMA1V 2H DMA2V 3H DMA3V 4H DMA4V 5H DMA5V 6H DMA6V 7H DMA7V 8H DMAB 9H DMAR AH Reserved BH CH DH EH FH
Address
Name
Address
00D0H INTE12 1H INTE3 2H 3H 4H INTETA01 5H INTETA23 6H 7H 8H INTETB0 9H AH INTETBO0 BH INTES0 CH INTES1 DH EH FH
00E0H INTE45 1H INTETB1 2H INTETBO1 3H INTESB0 4H 5H 6H 7H 8H 9H AH BH CH DH EH INTEP0 FH
00F0H INTE0AD 1H INTETC01 2H INTETC23 3H INTETC45 4H INTETC67 5H SIMC 6H IIMC 7H INTWDT 8H INTCLR 9H AH IIMC2 BH CH DH EH FH
[4] Memory controller Address
Name
[5] Clock gear/PLL Address
0150H 1H 2H 3H 4H 5H 6H 7H 8H BEXCSL 9H BEXCSH AH BH CH DH EH FH
Name
Address
0160H 1H 2H 3H 4H 5H
Name
Address
Name
0140H B0CSL 1H B0CSH 2H MAMR0 3H MSAR0 4H B1CSL 5H B1CSH 6H MAMR1 7H MSAR1 8H B2CSL 9H B2CSH AH MAMR2 BH MSAR2 CH B3CSL DH B3CSH EH MAMR3 FH MSAR3
10E0H SYSCR0 1H SYSCR1 2H SYSCR2 3H EMCCR0 4H EMCCR1 5H EMCCR2 6H Reserved 7H 8H PLLCR 9H Reserved AH BH CH DH EH FH
6H PMEMCR 7H 8H 9H AH BH CH DH EH FH
92CM22-230
2007-02-16
TMP92CM22
[6] 8-bit timer Address
1H 2H TA0REG 3H TA1REG 4H TA01MOD 5H TA1FFCR 6H 7H 8H TA23RUN 9H AH TA2REG BH TA3REG CH TA23MOD DH TA3FFCR EH FH
[7] 16-bit timer Address Name Address Name
1180H TB0RUN 1H 2H TB0MOD 3H TB0FFCR 4H 5H 6H 7H 8H TB0RG0L 9H TB0RG0H AH TB0RG1L BH TB0RG1H CH TB0CP0L DH TB0CP0H EH TB0CP1L FH TB0CP1H 1190H TB1RUN 1H 2H TB1MOD 3H TB1FFCR 4H 5H 6H 7H 8H TB1RG0L 9H TB1RG0H AH TB1RG1L BH TB1RG1H CH TB1CP0L DH TB1CP0H EH TB1CP1L FH TB1CP1H
[8] UART/SIO Address Name
1200H SC0BUF 1H SC0CRS 2H C0MOD0 3H BR0CR 4H BR0ADD 5H SC0MOD1 6H 7H SIRCR 8H SC1BUF 9H SC1CR AH SC1MOD0 BH BR1CR CH BR1ADD DH SC1MOD1 EH FH
Name
1100H TA01RUN
[9] I2C bus/SIO Address Name
1240H SBI0CR1 1H SBI0DBR 2H I2C0AR 3H SBI0CR2/SBI0SR 4H SBI0BR0 5H SBI0BR1 6H 7H 8H 9H AH BH CH DH EH FH
[10] 10-bit ADC Address Name Address
12B0H 1H 2H 3H 4H 5H 6H 7H 8H ADMOD0 9H ADMOD1 AH ADMOD2 BH Reserved CH DH EH FH
[11] WDT Name Address Name
1300H WDMOD 1H WDCR 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
12A0H ADREG0L 1H ADREG0H 2H ADREG1L 3H ADREG1H 4H ADREG2L 5H ADREG2H 6H ADREG3L 7H ADREG3H 8H ADREG4L 9H ADREG4H AH ADREG5L BH ADREG5H CH ADREG6L DH ADREG6H EH ADREG7L FH ADREG7H
92CM22-231
2007-02-16
TMP92CM22
(1) I/O port (1/3) Symbol
P1
Name
Port 1
Address
0004H
7
P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Data from external port (Output latch register is cleared to "0") P47 P4 Port 4 0010H P57 P5 Port 5 0014H P67 P6 Port 6 0018H P76
Data from external port (Output latch register is cleared to "0")
P46
P45
P44 R/W
P43
P42
P41
P40
Data from external port (Output latch register is cleared to "0") P56 P55 P54 R/W Data from external port (Output latch register is cleared to "0") P66 P65 P64 R/W Data from external port (Output latch register is cleared to "0") P75 P74 P73 R/W P7 Port 7 001CH P72 P71 P70 P63 P62 P61 P60 P53 P52 P51 P50
1
1
1
1
1
1
P83 P8 Port 8 0020H 1
P82 R/W 0 P92
P81 1 P91 R/W
P80 1 P90
P9
Port 9
0024H
Data from external port (Output latch register is set to "1") PA7 R PA Port A 0028H Data from external port PC6 R/W PC Port C 0030H Data from external port (Output latch register is set to "1") PC5 PC3 R/W
Data from external port (Output latch register is set to "1")
PA2
PA1 R
PA0
Data from external port PC1 R/W Data from external port (Output latch register is set to "1") PD2 R/W Data from external port (Output latch register is set to "1") PD1 PD0 PC0
PD3 PD Port D 0034H
PF7 PF Port F 003CH PG7 PG Port G 0040H
PF6
PF5
PF4 R/W
PF3
PF2
PF1
PF0
Data from external port (Output latch register is set to "1") PG6 PG5 PG4 R Data from external port PG3 PG2 PG1 PG0
92CM22-232
2007-02-16
TMP92CM22
I/O port (2/3) Symbol Name
Port 1 P1CR control register
Address
0006H (Prohibit RMW)
7
P17C 0
6
P16C 0
5
P15C 0
4
P14C W 0
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0 P1F
0: Input 1: Output W 0/1
0: Port 1: Data bus (D8 to D15)
Port 1 P1FC function register
0007H (Prohibit RMW)
Port 4 P4CR control register
0012H (Prohibit RMW)
P47C 0 P47F 1 P57C 0 P57F 1 P67C 0 P67F 1
P46C 0 P46F 1 P56C 0 P56F 1 P66C 0 P66F 1 P76C
P45C 0 P45F 1 P55C 0 P55F 1 P65C 0 P65F 1
P44C W 0 P44F W 1 P54C W 0 P54F W 1 P64C W 0 P64F W 1
P43C 0 P43F 1 P53C 0 P53F 1 P63C 0 P63F 1
P42C 0 P42F 1 P52C 0 P52F 1 P62C 0 P62F 1
P41C 0 P41F 1 P51C 0 P51F 1 P61C 0 P61F 1
P40C 0 P40F 1 P50C 0 P50F 1 P60C 0 P60F 1
0: Input 1: Output Port 4 P4FC function register 0013H (Prohibit RMW)
0: Port 1: Address bus (A0 to A7) Port 5 P5CR control register 0016H (Prohibit RMW)
0: Input 1: Output Port 5 P5FC function register 0017H (Prohibit RMW)
0: Port 1: Address bus (A8 to A15) Port 6 P6CR control register 001AH (Prohibit RMW)
0: Input 1: Output Port 6 P6FC function register 001BH (Prohibit RMW)
0: Port 1: Address bus (A16 to A23) Port 7 P7CR control register 001EH (Prohibit RMW) W 0 0: Input 1: Output P76F Port 7 P7FC function register 001FH (Prohibit RMW) 0 0: Port 1: WAIT P75F 0 0: Port 1: R/ W P74F 0 0: Port P73F W 0 0 0 0: Port 1: WRLL P81F W 0 0: Port 1: CS3 0 0: Port 1: CS2 0 0: Port 1: CS1 0 0: Port 1: CS0 1 0: Port 1: RD P80F 0: Port 0: Port 1: CLKOUT 1: Don't set. 1: WRLU P83F Port 8 P8FC control register 0023H (Prohibit RMW) P82F P72F P71F P70F
92CM22-233
2007-02-16
TMP92CM22
I/O port (3/3) Symbol Name
Port 9 P9CR control register
Address
0026H (Prohibit RMW)
7
6
5
4
3
2
P92C 0 P92F 0 0: Port, SI
1
P91C W 0 0: Input 1: Output P91F W 0 0: Port
0
P90C 0 P90F 0
Port 9 P9FC function register
0027H (Prohibit RMW)
0: Port, SCK 1: SCL 1: SO, SDA input 1: SCK Note output Note P92ODE P91ODE W 0
1: Open
Port 9 P9ODE ODE register
0025H (Prohibit RMW)
0
1: Open
drain PC6C Port C PCCR control register 0032H (Prohibit RMW) W 0 0: Input 1: Output PC6F Port C PCFC function register 0033H (Prohibit RMW) W 0 0
0: Port 0: Port 1: INT3 1: INT2 TB0OUT0 TA3OUT
drain PC1C W 0 0: Input 1: Output PC1F W 0 0
0: Port 0: Port 1: INT1 1: TA0IN TA1OUT
PC5C 0
PC3C W 0 0: Input 1: Output
PC0C 0
PC5F
PC3F W 1
0: Port 1: INT0
PC0F
PD3C Port D PDCR control register 0036H (Prohibit RMW) 0 0: Input 1: Output PD3F Port D PDFC function register 0037H (Prohibit RMW) 0
0: Port 1: TB1OUT1
PD2C W 0 0: Input 1: Output PD2F W 0
0: Port 1: TB1OUT0
PD1C 0 0: Input 1: Output PD1F 0
0: Port
PD0C 0 0: Input 1: Output PD0F 0
0: Port
1: TB0IN1 1: TB0IN0 INT5 input INT4 input
Port F PFCR control register
003EH (Prohibit RMW)
PF7C 0 -
PF6C 0 - W 0
Always write "0".
PF5C 0 PF5F 0
0: Port 1: SCLK1 output
PF4C W 0 0: Input
PF3C 0 1: Output PF3F W 0
0: Port 1: TXD1
PF2C 0 PF2F 0
0: Port 1: SCLK0 output
PF1C 0
PF0C 0 PF0F W 0
0: Port 1: TXD0
Port F PFFC function register
003FH (Prohibit RMW)
0
Always write "0".
Note: When using SI and SCK input function, set P9FC to "0" (Function setting).
92CM22-234
2007-02-16
TMP92CM22
(2) Interrupt control (1/2) Symbol Name
INT1 & INT2 enable
Address
7
I2C R 0 1: INT2 - - 0
6
INT2 I2M2 0 -
5
I2M1 R/W 0
4
I2M0 0
3
I1C R 0 1: INT1 I3C R 0 1: INT3 ITA0C R 0 1: INTTA0 ITA2C R 0 1: INTTA2 ITB0C R 0 1: INTTB0 ITBO0C R 0
1: INTTBO0
2
INT1 I1M2 0 INT3
1
I1M1 R/W 0
0
I1M0 0
INTE12
00D0H
Interrupt request level.
Interrupt request level
INTE3
INT3 enable
00D1H
- - 0
- - 0
- - 0
I3M2 0
I3M1 R/W 0
I3M0 0
Always write "0".
Interrupt request level
INTETA01
INTTA0 & INTTA1 enable
00D4H
ITA1C R 0 1: INTTA1 ITA3C R 0 1: INTTA3 ITB1C R 0 1: INTTB1 - R 0
INTTA1 (TMRA1) ITA1M2 ITA1M1 R/W 0 0 INTTA3 (TMRA3) ITA3M2 ITA3M1 R/W 0 0 INTTB1 (TMRB0) ITB1M2 ITB1M1 R/W 0 0 -
ITA1M0 0
INTTA0 (TMRA0) ITA0M2 ITA0M1 R/W 0 0 INTTA2 (TMRA2) ITA2M2 ITA2M1 R/W 0 0 INTTB0 (TMRB0) ITB0M2 ITB0M1 R/W 0 0 INTTBO0 (TMRB0) ITBO0M2 ITBO0M1 R/W 0 0 INTRX0 IRX0M2 IRX0M1 R/W 0 0 INTRX1 IRX1M2 IRX1M1 R/W 0 0 INT4
ITA0M0 0
Interrupt request level
Interrupt request level
INTETA23
INTTA2 & INTTA3 enable
ITA3M0 0
ITA2M0 0
00D5H
Interrupt request level
Interrupt request level
INTTB00 & INTETB01 INTTB01 enable
ITB1M0 0
ITB0M0 0
00D8H
Interrupt request level
Interrupt request level
INTTBO0 INTETBO0 (Overflow) enable 00DAH
- 0
- R/W 0
- 0
ITBO0M0
Always write "0".
Interrupt request level
INTES0
INTRX0 & INTTX0 enable
00DBH
ITX0C R 0 1: INTTX0 ITX1C R 0 1: INTTX1 I5C R 0 1: INT5 ITB11C R 0 1: INTTB11 - -
INTTX0 ITX0M2 ITX0M1 R/W 0 0 INTTX1 ITX1M2 ITX1M1 R/W 0 0 INT5
ITX0M0 0
Interrupt request level
IRX0C R 0 1: INTRX0 IRX1C R 0 1: INTRX1 I4C R 0 1: INT4 ITB10C R 0 1: INTTB10 ITBO1C R 0
IRX0M0 0
Interrupt request level
INTES1
INTRX1 & INTTX1 enable
ITX1M0 0
IRX1M0 0
00DCH
Interrupt request level
Interrupt request level
INTE45
INT4 & INT5 enable
I5M2 0
00E0H
I5M1 R/W 0
I5M0 0
I4M2 0
I4M1 R/W 0
I4M0 0
Interrupt request level
Interrupt request level
INTETB1
INTB10 & INTTB11 enable
00E1H
INTTB11 (TMRB1) ITB11M2 ITB11M1 R/W 0 0 -
ITB11M0 0
INTTB10 (TMRB1) ITB10M2 ITB10M1 R/W 0 0 INTTBO1 (TMRB1) ITBO1M2 ITBO1M1 R/W 0 0 INTSBE0 ISBE0M2 ISBE0M1 R/W 0 0
ITB10M0 0
Interrupt request level
Interrupt request level
INTTBO1 INTETBO1 (Overflow) enable 00E2H
- - -
- -
- -
ITBO1M0 0 ISBE0M0 0
Always write "0".
INTESB0
INTSBE0 enable
00E3H
- - -
- - - - - - Always write "0".
- - -
ISBE0C R 0
1: INTSBE0
Interrupt request level
92CM22-235
2007-02-16
TMP92CM22
Interrupt control (2/2) Symbol Name
INTP0 enable
Address
7
- - 0
6
- - - 0
5
- - 0
4
- - 0
3
IP0C R 0 1: INTP0 I0C R 0 1: INT0 ITC0C R 0 1: INTTC0 ITC2C R 0 1: INTTC2 ITC4C R 0 1: INTTC4 ITC6C R 0 1: INTTC6
2
1
0
IP0M0 0
INTEP0
00EEH
INTP0 IP0M2 IP0M1 R/W 0 0 INT0
Always write "0".
Interrupt request level
INTE0AD
INT0 & INTAD enable
00F0H
IADC R 0 1: INTAD ITC1C R 0 1: INTTC1 ITC3C R 0 1: INTTC3 ITC5C R 0 1: INTTC5 ITC7C R 0 1: INTTC7
INTAD IADM2 IADM1 R/W 0 0 INTTC1 (DMA1) ITC1M2 ITC1M1 R/W 0 0 INTTC3 (DMA3) ITC3M2 ITC3M1 R/W 0 0 INTTC5 (DMA5) ITC5M2 ITC5M1 R/W 0 0 INTTC7 (DMA7) ITC7M2 ITC7M1 R/W 0 0
IADM0 0
I0M2 0
I0M1 R/W 0
I0M0 0
Interrupt request level
Interrupt request level
INTETC01
INTTC0 & INTTC1 enable
ITC1M0 0
00F1H
INTTC0 (DMA0) ITC0M2 ITC0M1 R/W 0 0 INTTC2 (DMA2) ITC2M2 ITC2M1 R/W 0 0 INTTC4 (DMA4) ITC4M2 ITC4M1 R/W 0 0 INTTC6 (DMA6) ITC6M2 ITC6M1 R/W 0 0 IR1LE W
ITC0M0 0
Interrupt request level
Interrupt request level
INTETC23
INTTC2 & INTTC3 enable
ITC3M0 0
ITC2M0 0
00F2H
Interrupt request level
Interrupt request level
INTETC45
INTTC4 & INTTC5 enable
ITC5M0 0
ITC4M0 0
00F3H
Interrupt request level
Interrupt request level
INTETC67
INTTC6 & INTTC7 enable
ITC7M0 0
ITC6M0 0 IR0LE
00F4H
Interrupt request level
Interrupt request level
SIO SIMC interrupt mode control 00F5H (Prohibit RMW)
I3EDGE Interrupt IIMC input mode control 00F6H (Prohibit RMW) 0 INT3 0: Rising/ high 1: Falling/ low - - - - - - - - - Always write "0". CLRV5 0
I2EDGE 0 INT2 0: Rising/ high 1: Falling/ low - - - CLRV4 0
I1EDGE W 0 INT1 0: Rising/ high 1: Falling/ low INTWD R 0 1: INTWD CLRV3 W 0 I3LE
I0EDGE 0 INT0 0: Rising/ high 1: Falling/ low - - - CLRV2 0 I2LE W 0 INT2 0: Edge
1: Level
1 1 0: INTRX1 0: INTRX0 edge edge mode mode 1: INTRX1 1: INTRX0 level level mode mode I0LE NMIREE 0 INT0 0: Edge mode 1: Level mode - - - CLRV1 0 I1LE 0 INT1
0: Edge 1: Level
INTWDT
INTWD enable
00F7H
0 NMI 0: Falling 1: Falling and rising - - - CLRV0 0
INTCLR
Interrupt clear control
00F8H (Prohibit RMW)
Interrupt vector
Interrupt IIMC2 input mode control
00FAH (Prohibit RMW)
0 INT3
0: Edge 1: Level
92CM22-236
2007-02-16
TMP92CM22
(3) DMA controller Symbol Name
DMA0 start vector
Address
7
6
5
DMA0V5
4
DMA0V4 0 DMA1V4 0 DMA2V4 0 DMA3V4 0 DMA4V4 0 DMA5V4 0 DMA6V4 0 DMA7V4 0 DBST4 R/W 0 DREQ4 R/W 0
3
DMA0V3 0 DMA1V3 0 DMA2V3 0 DMA3V3 0 DMA4V3 0 DMA5V3 0 DMA6V3 0 DMA7V3 0 DBST3 0 DREQ3 0 R/W
2
DMA0V2 0 DMA1V2 0 DMA2V2 0 DMA3V2 0 DMA4V2 0 DMA5V2 0 DMA6V2 0 DMA7V2 0 DBST2 0 DREQ2 0
1
DMA0V1 0 DMA1V1 0 DMA2V1 0 DMA3V1 0 DMA4V1 0 DMA5V1 0 DMA6V1 0 DMA7V1 0 DBST1 0 DREQ1 0
0
DMA0V0 0 DMA1V0 0 DMA2V0 0 DMA3V0 0 DMA4V0 0 DMA5V0 0 DMA6V0 0 DMA7V0 0 DBST0 0 DREQ0 0
DMA0V
0100H
0 DMA1V5
DMA0 start vector DMA1 start vector R/W 0 DMA2V5 0102H 0 DMA3V5 0103H 0 DMA4V5 0104H 0 DMA5V5 0105H 0 DMA6V5 0106H 0 DMA7V5 0107H 0 DBST7 DMAB DMA burst 0108H 0 DREQ7 0 DBST6 0 DREQ6 0 DBST5 0 DREQ5 0 DMA1 start vector DMA2 start vector R/W DMA2 start vector DMA3 start vector R/W DMA3 start vector DMA4 start vector R/W DMA4 start vector DMA5 start vector R/W DMA5 start vector DMA6 start vector R/W DMA6 start vector DMA7 start vector R/W DMA7 start vector
DMA1V
0101H
DMA2V
DMA3V
DMA4V
DMA5V
DMA6V
DMA7V
1: DMA request on burst mode DMA request 0109H (Prohibit RMW)
DMAR
1: DMA request in software
92CM22-237
2007-02-16
TMP92CM22
(4) Memory controller (1/2) Symbol Name
Block 0 MEMC control register low
Address
7
6
B0WW2
5
B0WW1 W 1
4
B0WW0
3
2
B0WR2
1
B0WR1 W 1
0
B0WR0
B0CSL
0140H (Prohibit RMW)
B0E Block 0 MEMCT control register high 0 0141H (Prohibit RMW)
CS select 0: Disable 1: Enable
0 0 Write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved - - B0REC W 0
Always write "0".
B0OM1
0 0 Read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved B0OM0 B0BUS1 B0BUS0 0/1 0/1 Data bus width 00: 8 bits 01: 16 bits 10: Reserved 11: Reserved B1WR1 W 1 B1WR0
0
Always write "0".
0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
B0CSH
0 0 00: ROM/SRAM 01: Reserved 10: Reserved 11: Reserved
B1WW2 Block 1 MEMC control register low 0144H (Prohibit RMW)
B1CSL
B1E Block 1 MEMC control register high 0 0145H (Prohibit RMW)
CS select 0: Disable 1: Enable
0 0 Write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved - - B1REC W 0
Always write "0".
B1WW1 W 1
B1WW0
B1WR2
B1OM1
0 0 Read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved B1OM0 B1BUS1 B1BUS0 0/1 0/1 Data bus width 00: 8 bits 01: 16 bits 10: Reserved 11: Reserved B2WR1 W 1 B2WR0
0
Always write "0".
0
0: No insert dummy cycle (Default) 1: Insert dummy
B1CSH
0 0 00: ROM/SRAM 01: Reserved 10: Reserved 11: Reserved
B2WW2 Block 2 MEMC control register low 0148H (Prohibit RMW)
B2CSL
B2E Block 2 MEMC control register high 1 0149H (Prohibit RMW)
CS select 0: Disable 1: Enable
0 0 Write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved B2M - B2REC W 0
0: 16 MB 1: Sets area
B2WW1 W 1
B2WW0
B2WR2
B2OM1 0
0 0 Read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved B2OM0 B2BUS1 B2BUS0 0 0/1
Data bus width 00: 8 bits 01: 16 bits 10: Reserved 11: Reserved
0
Always write "0".
0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
0/1
B2CSH
00: ROM/SRAM 01: Reserved 10: Reserved 11: Reserved
B3WW2 Block 3 MEMC control register low 014CH (Prohibit RMW)
B3CSL
B3E Block 3 MEMC control register high 0 014DH (Prohibit RMW)
CS select 0: Disable 1: Enable
0 0 Write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved - - B3REC W 0
Always write "0".
B3WW1 W 1
B3WW0
B3WR2
B3OM1
0 0 Read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved B3OM0 B3BUS1 B3BUS0 0/1 0/1 Data bus width 00: 8 bits 01: 16 bits 10: Reserved 11: Reserved
B3WR1 W 1
B3WR0
0
Always write "0".
0
0: No insert dummy cycle (Default) 1: Insert dummy cycle
B3CSH
0 0 00: ROM/SRAM 01: Reserved 10: Reserved 11: Reserved
92CM22-238
2007-02-16
TMP92CM22
Memory controller (2/2) Symbol Name
Block EX MEMC BEXCSL control register low 0158H (Prohibit RMW)
Address
7
6
5
4
3
2
BEXWR2
1
BEXWR1 W 1
0
BEXWR0
BEXWW2 BEXWW1 BEXWW0 W 0 1 0 Write waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved - - - 0 Always write "0". 0 Always write "0". 0 Always write "0".
Block EX MEMC BEXCSH control register high 0159H (Prohibit RMW)
OPGE 0 0166H ROM page access
0: Disable 1: Enable
Page ROM PMEMCR control register
0 0 Read waits 001: 0 waits 010: 1 wait 101: 2 waits 110: 3 waits 111: 4 waits 011: WAIT pin Others: Reserved BEXOM1 BEXOM0 BEXBUS1 BEXBUS0 W 0 0 0/1 0/1 00: ROM/SRAM Data bus width 01: Reserved 00: 8 bits 10: Reserved 01: 16 bits 11: Reserved 10: Reserved 11: Reserved OPWR1 OPWR0 PR1 PR0 R/W 0 0 1 0 Wait number on page Byte number in a page 00: 1 state (n-1-1-1 mode) 00: 64 bytes 01: 2 states (n-2-2-2 mode) 01: 32 bytes 10: 3 states (n-3-3-3 mode) 10: 16 bytes 11: (Reserved) 11: 8 bytes M0V16 M0V15 M0V14-9 1 M0S17 1 MV15-9 1 M1S17 1 M2V16 1 M2S17 1 M3V16 1 M3S17 1 M0V8 1 M0S16 1 M1V8 1 M1S16 1 M2V15 1 M2S16 1 M3V15 1 M3S16 1
MAMR0
Memory mask register 0 Memory start address register 0 Memory mask register 1 Memory start address register 1 Memory mask register 2 Memory start address register 2 Memory mask register 3 Memory start address register 3
M0V20 0142H 1 M0S23 0143H 1 M1V21 0146H 1 M1S23 0147H 1 M2V22 014AH 1 M2S23 014BH 1 M3V22 014EH 1 M3S23 014FH 1
M0V19 1 M0S22 1 M1V20 1 M1S22 1 M2V21 1 M2S22 1 M3V21 1 M3S22 1
M0V18
M0V17 R/W
MSAR0
1 1 1 1 0: Compare enable 1: Compare disable M0S21 M0S20 M0S19 M0S18 R/W 1 1 1 1 Set start address A23 to A16 M1V19 M1V18 R/W 1 1 1 1 0: Compare enable 1: Compare disable M1S21 M1S20 M1S19 M1S18 R/W 1 1 1 1 Set start address A23 to A16 M2V20 M2V19 R/W 1 1 1 1 0: Compare enable 1: Compare disable M2S21 M2S20 M2S19 M2S18 R/W 1 1 1 1 Set start address A23 to A16 M3V20 M3V19 R/W 1 1 1 1 0: Compare enable 1: Compare disable M3S21 M3S20 M3S19 M3S18 R/W 1 1 1 1 Set start address A23 to A16 M3V18 M3V17 M2V18 M2V17 M1V17 M1V16
MAMR1
MSAR1
MAMR2
MSAR2
MAMR3
MSAR3
92CM22-239
2007-02-16
TMP92CM22
(5) Clock gear Symbol Name
System SYSCR0 clock control 0 10E0H
Address
7
- R/W 1 Always write "1".
6
5
4
3
2
- R/W 0 Always write "0".
1
0
- 0 Always write "0". System SYSCR1 clock control 1 10E1H
GEAR2 R/W 1
GEAR1 0
GEAR0 0
Select gear value of high frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (Reserved) 110: (Reserved) 111: (Reserved)
- R/W 0 System SYSCR2 clock control 2 10E2H Always write "0".
WUPTM1 1
WUPTM0 0
HALTM1 1 HALT mode
HALTM0 1
SELDRV 0 mode select 0: STOP 1: IDLE1
DRVE 0 Pin state control in STOP mode
0: I/O off 1: Remains the state before halt
R/W Warm-up timer 00: Reserved 01: 2 /input frequency
14 16 8
00: Reserved 01: STOP mode
10: 2 /input frequency 10: IDLE1 mode 11: 2 /input frequency 11: IDLE2 mode
PLLON R/W 0 0: PLL off PLLCR PLL control 1: PLL on 10E8H
FCSEL 0 fc select 0: OSCH
LWUPFG R 0 PLL
warm-up 1: PLL (x4) flag 0: Don't end warm up 1: End warm up
PROTECT R EMC EMCCR0 control register 0 10E3H 0 Protect flag 0: OFF 1: ON EMC EMCCR1 control register 1 EMC EMCCR2 control register 2 10E5H 10E4H
EXTIN 0
1: External clock
DRVOSCH R/W 1
fc oscillator driver ability 1: NORMAL 0: WEAK
- 1 Always write "1".
Switching the protect ON/OFF by write to following 1st-KEY, 2nd-KEY 1st-KEY: EMCCR1 = 5AH, EMCCR2 = A5H in succession write 2nd-KEY: EMCCR1 = A5H, EMCCR2 = 5AH in succession write
92CM22-240
2007-02-16
TMP92CM22
(6) 8-bit timer Symbol Name
TMRA01 TA01RUN RUN register 1100H
Address
7
TA0RDE R/W 0
Double buffer 0: Disable 1: Enable
6
5
4
3
I2TA01 0
2
TA01PRUN
1
TA1RUN R/W 0
0
TA0RUN 0
UP counter (UC0)
0
IDLE2 TMRA01 UP counter prescaler (UC1) 0: Stop 1: Operate 0: Stop and clear 1: Run (Count up)
TA0REG
8-bit timer register 0 8-bit timer register 1
1102H (Prohibit RMW) 1103H (Prohibit RMW) TA01M1 0 1104H
Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
- W Undefined - W Undefined TA01M0 0 PWM01 0
PWM cycle
TA1REG
TMRA01 TA01MOD mode register
PWM00 TA1CLK1 TA1CLK0 R/W 0 0 0
Source clock for TMRA1
TA0CLK1 TA0CLK0 0 00: TA0IN pin 01: T1 10: T4 11: T16 TA1FFIE TA1FFIS R/W 0 0
TA1FF TA1FF control for inversion inversion select 0: Disable 1: Enable
0: TMRA0 1: TMRA1
0
Source clock for TMRA0
00: Reserved 6 01: 2 7 10: 2 8 11: 2
00: TA0TRG 01: T1 10: T16 11: T256 TA1FFC1 W TA1FFC0 1
TMRA1 TA1FFCR flip-flop control register 1105H (Prohibit RMW)
1
00: Invert TA1FF 01: Set TA1FF 10: Clear TA1FF 11: Don't care
TMRA23 TA23RUN RUN register 1108H
TA2RDE R/W 0
Double buffer 0: Disable 1: Enable
I2TA23 0
TA23PRUN
0
TA3RUN R/W 0
TA2RUN 0
UP counter (UC2)
IDLE2 TMRA23 UP counter prescaler (UC3) 0: Stop 1: Operate 0: Stop and clear
1: Run (Count up)
TA2REG
8-bit timer register 2 8-bit timer register 3
110AH (Prohibit RMW) 110BH (Prohibit RMW) TA23M1 0 110CH
Operation mode 00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
- W
Undefined
- W
Undefined
TA3REG
TA23M0 0
PWM21 0
PWM cycle
TMRA23 TA23MOD mode register
PWM20 TA3CLK1 TA3CLK0 R/W 0 0 0
Source clock for TMRA3
TA2CLK1 TA2CLK0 0 00: Reserved 01: T1 10: T4 11: T16 0
Source clock for TMRA2
00: Reserved 6 01: 2 7 10: 2 8 11: 2
00: TA2TRG 01: T1 10: T16 11: T256 TA3FFC1 W TA3FFC0 1
TA3FFCR
TMRA3 flip-flop control register
110DH (Prohibit RMW)
1
01: Set TA3FF 10: Clear TA3FF 11: Don't care
TA3FFIE TA3FFIS R/W 0 0
TA3FF TA3FF control for inversion inversion select 0: Disable 1: Enable
0: TMRA2 1: TMRA3
00: Invert TA3FF
92CM22-241
2007-02-16
TMP92CM22
(7) 16-bit timer (1/2) Symbol Name
Timer B0 TB0RUN RUN register 1180H
Address
7
6
5
4
3
I2TB0 0 IDLE2
2
TB0PRUN R/W 0
TMRB0 prescaler 0: Stop and clear 1: Run (Count up)
1
0
TB0RUN R/W 0
UP counter (UC10)
TB0RDE - R/W 0 0 Double Always buffer write "0". 0: Disable 1: Enable - R/W 0 Always write "0". - 0 Always write "0". TB0CP0I W 1
0: Stop 1: Operate
TB0CPM1 TB0CPM0
Timer B0 TB0MOD mode register
1182H (Prohibit RMW)
0 0 Capture timing 00: Disable 01: Reserved 0: Software 10: Reserved 11: TA1OUT capture TA1OUT Software capture control
1: Undefined
TB0CLE R/W 0
Up counter control
TB0CLK1 TB0CLK0 0 0 Timer B0 source clock 00: Reserved 01: T1 10: T4 11: T16
0: Clear disable 1: Clear enable TB0E0T1 0
- W* Timer B0 TB0FFCR flip-flop control register
-
TB0C1T1 0
1 1 Always write "11". 1183H (Prohibit RMW)
TB0C0T1 TB0E1T1 R/W 0 0
TB0FFC1 TB0FFC0 W* 1 1 Control TB0FF0 00: Invert 01: Set
TB0FF0 inversion trigger 0: Trigger disable 1: Trigger enable
Invert when the UC10 value is loaded in to TB0CP1H/L. Invert when the UC10 value is loaded in to TB0CP0H/L.
Invert when Invert when 10: Clear the UC10 the UC10 11: Don't care matches with matches with * Always read as 11. TB0RG1H/L. TB0RG0H/L.
16-bit timer 1188H TB0RG0L register 0 (Prohibit low RMW) 16-bit timer 1189H TB0RG0H register 0 (Prohibit high RMW) 16-bit timer 118AH TB0RG1L register 1 (Prohibit low RMW) 16-bit timer 118BH TB0RG1H register 1 (Prohibit high RMW) TB0CP0L Capture register 0 low 118CH
- W Undefined - W Undefined - W Undefined - W Undefined - R Undefined - R Undefined - R Undefined - R Undefined
Capture TB0CP0H register 0 high TB0CP1L Capture register 1 low
118DH
118EH
Capture TB0CP1H register 1 high
118FH
92CM22-242
2007-02-16
TMP92CM22
16-bit timer (2/2) Symbol Name Address 7
TB1RDE R/W Timer B1 TB1RUN RUN register 1190H 0
Double buffer 0: Disable 1: Enable
6
- 0
Always write "0".
5
4
3
I2TB0 0
IDLE2 0: Stop 1: Operate
2
TB1PRUN R/W 0
TMRB1 prescaler
1
0
TB1RUN R/W 0
UP counter (UC12)
0: Stop and clear 1: Run (Count up)
TB1CT1
TB1ET1 R/W
TB1CP0I W 1
TB1CPM1
TB1CPM0
TB1CLE R/W 0
TB1CLK1 0
TB1CLK0 0
Timer B1 TB1MOD mode register
0 0 Software Capture timing 1192H 00: Disable capture control 01: TB1N0 TB1IN1 (Prohibit 0: Software 10:TB1IN0 TB1IN0 RMW) capture 11: TA1OUT Invert when Invert when 1: Undefined TA1OUT UC12 is UC12
loaded into matches TB1CP1H/L with TB1RG1H/L
0 0 TB1FF1 inversion trigger 0: Disable trigger 1: Enable trigger
Up counter Timer B1 source clock control 00: TB1IN0 pin input
0: Clear disable 1: Clear enable
01: T1 10: T4 11: T16
TB1FF1C1 TB1FF1C0 TB1C1T1 W* 1 Timer B1 TB1FFCR flip-flop control register Control TB1FF1 1193H (Prohibit RMW) 00: Invert 01: Set 10: Clear 11: Don't care *Always read as 11. 1 0
TB1C0T1 0
TB1E1T1 0
TB1E0T1 0
TB1FFC1 1
TB1FFC0 1
R/W TB0FF0 inversion trigger 0: Disable trigger 1: Enable trigger
Invert when the UC12 value is loaded in to TB1CP1H/L. Invert when the UC12 value is loaded in to TB1CP0H/L. Invert when the UC12 value matches the value in TB1RG1H/L.
W* Control TB1FF0 00: Invert 01: Set
Invert when 10: Clear the UC12 11: Don't care value *Always read as 11. matches the value in TB1RG0H/L.
16-bit timer TB1RG0L register 0 low 16-bit timer TB1RG0H register 0 high 16-bit timer TB1RG1L register 1 low 16-bit timer TB1RG1H register 1 high Capture TB1CP0L register 0 low Capture TB1CP0H register 0 high Capture TB1CP1L register 1 low Capture TB1CP1H register 1 high
1198H (Prohibit RMW) 1199H (Prohibit RMW) 119AH (Prohibit RMW) 119BH (Prohibit RMW) 119CH
W Undefined W Undefined W Undefined W Undefined R Undefined
119DH
R Undefined
119EH
R Undefined
119FH
R Undefined
92CM22-243
2007-02-16
TMP92CM22
(8) UART/Serial channel (1/2) Symbol
SC0BUF
Name Address
Serial channel 0 buffer register Serial 1200H (Prohibit RMW)
7
RB7 TB7
6
RB6 TB6
5
4
3
2
1
RB1 TB1
0
RB0 TB0
RB5 RB4 RB3 RB2 TB5 TB4 TB3 TB2 R(Receiving) / W(Transmission) Undefined PE R/W 0 Parity 0: Disable 1: Enable RXE 0 OERR PERR FERR R (Clear o after reading) 0 0 0 1: Error Overrun Parity Framing
SC0CR
channel 0 control register
RB8 R Undefined 1201H Receive data bit8 TB8
EVEN 0 Parity 0: Odd 1: Even CTSE 0 0: CTS disable 1: CTS enable BR0ADDE 0 (16 - K)/ 16 divided 0: Disable 1: Enable
SCLKS R/W 0
0: SCLK0 1: SCLK0
IOC 0
0: Baud rate generator 1: SCLK0 pin input
WU R/W 0
SM1
SM0
SC1
SC0
Serial SC0MOD0 channel 0 mode 0 register 1202H
0 Transmission data bit8
- Serial channel 0 BR0CR baud rate control register Serial BR0ADD channel 0 K setting register 1204H 1203H 0 Always write "0".
0 0 0 0 00: I /O interface mode 00: Timer TA0REG 0: Receive Wake up 01: 7-bit UART mode 01: Baud rate disable 0: Disable generator 10: 8-bit UART mode 1: Receive 1: Enable 11: 9-bit UART mode 10: Internal clock fio enable 11: External clock (SCLK0 input) BR0CK1 BR0CK0 BR0S3 BR0S2 BR0S1 BR0S0 R/W 0 0 0 0 0 0 00: T0 01: T2 Divided frequency setting 10: T8 11: T32 BR0K3 0 BR0K2 R/W 0 0 Sets frequency divisor "K" (divided by N + (16 - K)/16). 0 BR0K1 BR0K0
I2S0 Serial SC0MOD1 channel 0 mode 1 register 1205H 0 IDLE2 0: Stop 1: Operate PLSEL 0 Select transmit pulse width 0: 3/16 1: 1/16 R/W
FDPX0 0
I/O interface mode 0: Half duplex 1: Full duplex
RXSEL 0
Receive data
TXEN 0 Transmit
RXEN 0 Receive
IrDA SIRCR control register 1207H
SIRWD3 R/W 0
SIRWD2 0
SIRWD1 0
SIRWD0 0
Select receive pulse width
0: "H" pulse 1: Enable 1: "L" pulse
0: Disable 0: Disable Set effective pulse width for equal or more 1: Enable than 2x x (Value + 1) + 100 ns Can be set: 1 to 14 Can not be set: 0, 15
92CM22-244
2007-02-16
TMP92CM22
UART/Serial channel (2/2) Symbol
SC1BUF
Name Address
Serial channel 1 buffer register 1208H (Prohibit RMW)
7
RB7 TB7
6
RB6 TB6
5
4
3
2
1
RB1 TB1
0
RB0 TB0
RB5 RB4 RB3 RB2 TB5 TB4 TB3 TB2 R (Receiving)/W (Transmission) Undefined PE R/W 0 Parity 0: Disable 1: Enable OERR PERR FERR R (Clear 0 after reading) 0 0 0 1: Error Overrun Parity Framing
Serial SC1CR channel 1 control register 1209H
RB8 R Undefined Receive data bit8
EVEN 0 Parity 0: Odd 1: Even
SCLKS R/W 0
IOC 0
0: SCLK1 0:Baud 1: SCLK1 rate
generator 1:SCLK1 pin input
TB8 Serial SC1MOD0 channel 1 mode 0 register 120AH
CTSE
RXE 0
WU R/W 0
SM1
SM0
SC1
SC0
0 0 Transmis- 0: CTS sion data disable bit8 1: CTS enable -
0: Receive Wake up disable 0: Disable 1: Enable 1: Receive enable
BR1ADDE BR1CK1 0 (16 - K)/ 16 divided 0: Disable 1: Enable 00: 01: 10: 11: 0 T0 T2 T8 T32
Serial channel 1 BR1CR baud rate control register Serial BR1ADD channel 1 K setting register 120CH 120BH 0 Always write "0".
0 0 0 0 00: I/O interface mode 00: Timer TA0REG 01: 7-bit UART mode 01: Baud rate generator 10: 8-bit UART mode 11: 9-bit UART mode 10: Internal clock fIO 11: External clock (SCLK1 input) BR1CK0 BR1S3 BR1S2 BR1S1 BR1S0 R/W 0 0 0 0 0 Divided frequency setting BR1K3 0 BR1K2 R/W 0 0 Sets frequency divisor "K" (divided by N + (16 - K)/16). 0 BR1K1 BR1K0
I2S1 Serial SC1MOD1 channel 1 mode 1 register 120DH 0 IDLE2 0: Stop 1: Operate R/W
FDPX1 0
I/O interface mode 0: Half duplex 1: Full duplex
92CM22-245
2007-02-16
TMP92CM22
(9) I2C bus/Serial channel (1/2) Symbol Name Address 7
BC2 1240H (Prohibit RMW) 2 I C mode SBI0 SBI0CR1 control register 1
6
BC1
5
BC0 0 011: 3 111: 7 SIOM1 W 0 Transfer mode
4
ACK R/W 0
Acknowledge mode
3
2
1
0
W 0 0 Number of transfer bits 000: 8 001: 1 010: 2 100: 4 101: 5 110: 6 SIOS SIOINH 0 Transfer
0: Continue 1: Abort
0: Disable 1: Enable SIOM0 0
1240H 0 (Prohibit Transfer RMW) 0: Stop SIO mode 1: Start
SCK0/ SCK2 SCK1 SWRMON W R/W 0 0 0/1 Setting of the divide value "n" 000: 5 001: 6 010: 7 011: 8 100: 9 101: 10 110: 11 111: Reserved SCK0 SCK2 SCK1 W 0 0 0 Setting of the divide value "n" 000:4 001:5 010:6 011:7 100:8 101:9 110:10 111:External clock SCK0 DB1 DB0
00: 8-bit transmit 10: 8-bit transmit/receive 11: 8-bit receive
SBI0 SBI0DBR buffer register
1241H (Prohibit RMW)
DB7
DB6
DB5 DB4 DB3 DB2 R (Receiving)/W (Transmission) Undefined SA4 0 SA3 W 0 SA2 0 SA1 0
SA6 I C bus0 I2C0AR address register
2
SA5 0
SA0 0
ALS 0 Address recognition 0 :Enable 1: Disable LARB/ SWRST0 0
Last received bit monitor 0: 0 1: 1
1242H (Prohibit RMW
0
Setting slave address
MST
TRX
BB
PIN
AL/SBIM1
AAS/ SBIM0 0
Slave address match detection monitor 0: Undetect 1: Detect
AD0/ SWRST 0
GENERAL CALL detection monitor 0:Undetect 1: Detect
W Serial bus SBI0SR interface status when read register 0 0: Slave 1: Master 1243H (I C mode) (Prohibit RMW) Serial bus SBI0CR2 interface when write control register2 Start/stop condition generation 0: Start condition 1: Stop condition
2
0
0
1 INTSBE0 request monitor 0: Request 1: Cancel
0
Arbitration lost detection monitor 0: - 1: Detect
0: Receive Bus status 1: Transmit monitor 0: Free 1: Busy
Serial bus interface operating mode selection 00: Port mode 01: SIO mode 2 10: I C bus mode 11: (Reserved) SIOF/ SBIM1 SEF/ SBIM2 R/W 0 0
Software reset generate write "10" and "01", then an internal reset signal is generated.
- W 0
-
Serial bus SBI0SR interface status when read register
0
1243H (SIO mode) (Prohibit RMW)
Transmit Shift operation status monitor status monitor 0: Stopped 0: Stopped 1: Terminated 1: Terminated in progress in progress
Serial bus SBI0CR2 interface when write control register2
Serial bus interface operating mode selection 00: Port mode 01: SIO mode 2 10: I C bus mode 11: (Reserved)
Always write "0".
Always write "0".
92CM22-246
2007-02-16
TMP92CM22
I2C bus/Serial channel (2/2) Symbol Name Address 7 6
I2SBI0 R/W 0 IDLE2 0: Abort 1: Operate - R/W 0 Always write "0". - W 0 Always write "0".
5
4
3
2
1
0
SBI0 SBI0BR0 baud rate register 0
- W 1244H 2 0 (I C mode) (Prohibit Always write "0". RMW) - 1244H W (SIO mode) 0 (Prohibit Always RMW) write "0". P4EN R/W 0 1245H Clock control 0: Stop 1: Operate
SBI0 SBI0BR1 baud rate register 1
92CM22-247
2007-02-16
TMP92CM22
(10) AD converter (1/2) Symbol Name Address 7
EOCF R 0 0 Always AD AD conversion conversion write "0". end flag busy flag 0: Busy 0: End 1: Busy 1: End 0 0 Always write "0".
6
ADBF
5
-
4
-
3
ITM0
2
REPEAT R/W 0 Repeat mode 0: Single mode 1: Repeat mode
1
SCAN 0 Scan mode 0: Fixed channel mode 1: Channel scan mode ADCH1 0
0
ADS 0 AD conversion start 1: Start Always read as "0". ADCH0 0
ADMOD0
AD mode control register 0
12B8H
0 0: Every 1 time 1: Every 4 times
VREFON
I2AD
-
- R/W 0 Always write "0".
- 0 Always write "0".
ADCH2 0
0 0 0 Always Ladder IDLE2 write "0". resistance 0: Stop 1: Operate 0: OFF 1: ON ADMOD1 AD mode control register 1 12B9H
Input channel 000: AN0 AN0 001: AN1 AN0AN1 010: AN2 AN0AN1AN2 011: AN3 AN0AN1AN2AN3 100: AN4 AN0AN1AN2AN3 AN4 101: AN5 AN0AN1AN2AN3 AN4AN5 110: AN6 AN0AN1AN2AN3 AN4AN5AN6 111: AN7 AN0AN1AN2AN3 AN4AN5AN6AN7
ADTRG R/W 0 ADMOD2 AD mode control register 2 12BAH
AD external trigger start control 0: Disable 1: Enable
AD result ADREG0L register 0 low AD result ADREG0H register 0 high AD result ADREG1L register 1 low AD result ADREG1H register 1 high AD result ADREG2L register 2 low AD result ADREG2H register 2 high AD result ADREG3L register 3 low AD result ADREG3H register 3 high
ADR01 12A0H
ADR00 R Undefined ADR08 ADR07 ADR06 ADR05 R Undefined ADR04 ADR03
ADR0RF R 0 ADR02
ADR09 12A1H ADR11 12A2H
ADR10 R Undefined ADR18 ADR17 ADR16 R Undefined ADR15 ADR14 ADR13
ADR1RF R 0 ADR12
ADR19 12A3H ADR21 12A4H
ADR20
R Undefined ADR29 ADR28 ADR27 ADR26 ADR25 R Undefined ADR24 ADR23
ADR2RF R 0 ADR22
12A5H ADR31 12A6H ADR30 R Undefined ADR38 ADR37
ADR3RF R 0 ADR36 R Undefined ADR35 ADR34 ADR33 ADR32
ADR39 12A7H
92CM22-248
2007-02-16
TMP92CM22
AD converter (2/2) Symbol
ADREG4L
Name
AD result register 4 low AD result
Address 12A8H
7
ADR41 R Undefined ADR49
6
ADR40
5
4
3
2
1
0
ADR4RF R 0
ADR48
ADR47
ADR46 R
ADR45
ADR44
ADR43
ADR42
ADREG4H
register 4 high AD result
12A9H ADR51 12AAH ADR59 12ABH ADR61 12ACH ADR69 12ADH ADR71 12AEH ADR79 12AFH R Undefined ADR78 ADR77 ADR76 ADR70 R Undefined ADR68 ADR67 ADR66 ADR60 R Undefined ADR58 ADR57 ADR56 ADR50
Undefined ADR5RF R 0 ADR55 R Undefined ADR6RF R 0 ADR65 R Undefined ADR7RF R 0 ADR75 R Undefined ADR74 ADR73 ADR72 ADR64 ADR63 ADR62 ADR54 ADR53 ADR52
ADREG5L
register 5 Low AD result
ADREG5H
register 5 high AD result
ADREG6L
register 6 low AD result
ADREG6H
register 6 high AD result
ADREG7L
register 7 low AD result
ADREG7H
register 7 high
92CM22-249
2007-02-16
TMP92CM22
(11) Watchdog timer Symbol Name Address 7
WDTE 1 1300H WDT control 1: Enable
6
WDTP1 R/W 0
5
WDTP0 0
4
3
- 0 Always write "0".
2
I2WDT R/W 0
1
RESCR
0
-
WDT WDMOD mode register
Select detecting time 15 00: 2 /fIO 17 01: 2 /fIO 19 10: 2 /fIO 21 11: 2 /fIO -
0 0 1: Internally Always connects write "0". 0: Stop WDT out 1: Operate to the reset pin. IDLE2
WDT WDCR control register
1301H (Prohibit RMW)
W - B1H: WDT disable code 4E: WDT clear code
92CM22-250
2007-02-16
TMP92CM22
6.
Port Section Equivalent Circuit Diagram
Reading the circuit diagram Basically, the gate symbols written are the same as those used for the standard CMOS logic IC [74HCXX] series. The dedicated signal is described below. STOP: This signal becomes active "1" when the halt mode setting register is set to the STOP mode and the CPU executes the HALT instruction. When the drive enable bit is set to "1", however, STOP remains at "0". The input protection resistance ranges from several tens of ohms to several hundreds of ohms. Data bus (D0 to D7), P1 (D8 to D15), P4 (A0 to A7), P5 (A8 to A15), P6 (A16 to A23), P76 ( WAIT ), PD2 (TB1OUT0), PD3 (TB1OUT1), PF6, and PF7
VCC
Output data Output enable
Stop
P-ch
N-ch
Input data
I/O
Input enable
P90 (SCK), PC0 (TA0IN), PC1 (TA1OUT/INT1), PC3 (INT0), PC5 (TA3OUT/INT2), PC6 (TB0OUT/INT3), PD0 (INT4/TB1IN0), PD1 (INT5/TB1IN1), PF1 (RXD0), PF2 (SCLK0/ CTS0 ), PF4 (RXD1), and PF5 (SCLK1/ CTS1 )
VCC
Output data Output enable
Stop
P-ch
N-ch
Input data
I/O
Input enable
92CM22-251
2007-02-16
TMP92CM22
P70 ( RD ), P71 ( WRLL ), P72 ( WRLU ), P73, P74 (CLKOUT), P75 ( R/ W ), P80 ( CS0 ), P81 ( CS1 ), P82 ( CS2 ), and P83 ( CS3 )
VCC Output data P-ch Output Stop N-ch
PA0, PA1, PA2, and PA7
VCC
Input data
Input
P91 (SO/SDA) and P92 (SI/SCL)
VCC Output data P-ch
Open-drain output enable Stop Input data
N-ch
I/O
Input enable
92CM22-252
2007-02-16
TMP92CM22
PF0 (TXD0) and PF3 (TXD1)
VCC Output data P-ch
Open-drain output enable Stop Input data
N-ch
I/O
Input enable
PG0 (AN0), PG1 (AN1), PG2 (AN2), PG3 (AN3/ ADTRG ), PG4 (AN4), PG5 (AN5), PG6 (AN6), and PG7 (AN7)
Analog input channel select Analog input
P-ch
Input N-ch
Input data
Input enable
RESET
VCC 100 k (Typ.) RESET Schmitt WDTOUT Reset enable Input
92CM22-253
2007-02-16
TMP92CM22
X1 and X2
Clock Oscillator X2
High-frequency oscillation enable
P-ch
N-ch
X1
VREFH and VREFL
VREFON P-ch VREFH
String resistance
VREFL
AM0 and AM1
Input data
Input
NMI
NMI
Input Schmitt
92CM22-254
2007-02-16
TMP92CM22
7.
Points to Note and Restrictions
(1) Notation 1. 2. The notation for built-in I/O registers is as follows register symbol . Example: TA01RUN denotes bit TA0RUN of register TA01RUN. Read-modify-write instructions (RMW)
An instruction in that the CPU reads data from memory and writes the data to the same memory location by using one instruction.
Example 1: SET Example 2: INC * 3, (TA01RUN) ... Set bit3 of TA01RUN. 1, (100H) ... Increment the data at 100H.
Examples of read-modify-write instructions on the TLCS-900 Exchange instruction EX (mem), R Arithmetic operations ADD (mem), R/# SUB (mem), R/# INC #3, (mem) Logic operations AND (mem), R/# XOR (mem), R/# Bit manipulation operations STCF #3/A, (mem) SET #3, (mem) TSET #3, (mem) Rotate and shift operations RLC (mem) RRC RL (mem) RR SLA (mem) SRA SLL (mem) SRL RLD (mem) RRD
ADC SBC DEC
(mem), R/# (mem), R/# #3, (mem)
OR
(mem), R/#
RES CHG
#3, (mem) #3, (mem)
(mem) (mem) (mem) (mem) (mem)
3.
fOSCH, fc, fFPH, fSYS, and one state
The clock frequency that is inputted from X1 and X2 is called "fOSCH". The clock that is selected by PLLCR register is called "fc". The clock that selected by SYSCR1 is called "fFPH". The clock frequency that is give by "fFPH" divided by 2 is called "fSYS". One cycle of "fSYS" is referred to as one state.
92CM22-255
2007-02-16
TMP92CM22
(2) Points to note a) AM0 and AM1 pins This pin is connected to the VCC (Power supply level) or VSS (Ground level) pins. Do not alter the level when the pin is active. b) c) Reservation area of address area TMP92CM22 don't include reservation area. Warm-up counter The warm-up counter operates when STOP mode is released, even if the system is using an external oscillator. As a result a time equivalent to the warm-up time elapses between input of the release request and output of the system clock. d) Watchdog timer The watchdog timer starts operation immediately after a reset is released. When the watchdog timer is not to be used, disable it. e) AD converter The string resistor between the VREFH and VREFL pins can be cut by a program so as to reduce power consumption. When STOP mode is used, disable the resistor using the program before the HALT instruction is executed. f) CPU (micro DMA) Only the LDC cr, r and LDC r, cr instructions can be used to access the control registers in the CPU (e.g., the transfer source address register (DMASn)). g) Undefined SFR bit The value of an undefined bit in an SFR (Special function register) is undefined when read. h) POP SR instruction Please execute the POP SR instruction during DI condition.
92CM22-256
2007-02-16
TMP92CM22
8.
Package Dimensions
P-LQFP100-144-0.50F Unit: mm
92CM22-257
2007-02-16
TMP92CM22
92CM22-258
2007-02-16


▲Up To Search▲   

 
Price & Availability of TMP92CM22FG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X